當前位置: 首頁>>代碼示例>>Python>>正文


Python DataLayer.execute_none方法代碼示例

本文整理匯總了Python中enarksh.DataLayer.DataLayer.execute_none方法的典型用法代碼示例。如果您正苦於以下問題:Python DataLayer.execute_none方法的具體用法?Python DataLayer.execute_none怎麽用?Python DataLayer.execute_none使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在enarksh.DataLayer.DataLayer的用法示例。


在下文中一共展示了DataLayer.execute_none方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: _drop_views

# 需要導入模塊: from enarksh.DataLayer import DataLayer [as 別名]
# 或者: from enarksh.DataLayer.DataLayer import execute_none [as 別名]
 def _drop_views():
     """
     Drops all views form the databases.
     """
     rows = DataLayer.execute_rows('SELECT TABLE_NAME table_name '
                                   'FROM   information_schema.TABLES '
                                   'WHERE  TABLE_SCHEMA = database() '
                                   'AND    TABLE_TYPE   = "VIEW" '
                                   'ORDER BY table_name')
     for row in rows:
         print('Dropping view %s' % row['table_name'])
         DataLayer.execute_none('drop view %s' % row['table_name'])
開發者ID:OlegKlimenko,項目名稱:py-enarksh,代碼行數:14,代碼來源:Bootsrap.py

示例2: _drop_routines

# 需要導入模塊: from enarksh.DataLayer import DataLayer [as 別名]
# 或者: from enarksh.DataLayer.DataLayer import execute_none [as 別名]
 def _drop_routines():
     """
     Drops all stored routines form the databases.
     """
     rows = DataLayer.execute_rows('select ROUTINE_TYPE routine_type '
                                   ',      ROUTINE_NAME routine_name '
                                   'from   information_schema.ROUTINES '
                                   'where  ROUTINE_SCHEMA = database() '
                                   'and    ROUTINE_TYPE   = "PROCEDURE" '
                                   'order by ROUTINE_NAME')
     for row in rows:
         print('Dropping %s %s' % (row['routine_type'], row['routine_name']))
         DataLayer.execute_none('drop %s %s' % (row['routine_type'], row['routine_name']))
開發者ID:OlegKlimenko,項目名稱:py-enarksh,代碼行數:15,代碼來源:Bootsrap.py

示例3: _drop_tables

# 需要導入模塊: from enarksh.DataLayer import DataLayer [as 別名]
# 或者: from enarksh.DataLayer.DataLayer import execute_none [as 別名]
    def _drop_tables():
        """
        Drops all tables form the databases.
        """
        DataLayer.execute_none('set foreign_key_checks = off')

        rows = DataLayer.execute_rows('SELECT TABLE_NAME table_name '
                                      'FROM   information_schema.TABLES '
                                      'WHERE  TABLE_SCHEMA = database() '
                                      'AND    TABLE_TYPE   = "BASE TABLE" '
                                      'ORDER BY TABLE_NAME')
        for row in rows:
            print('Dropping table %s' % row['table_name'])
            DataLayer.execute_none('drop table %s cascade' % row['table_name'])

        DataLayer.execute_none('set foreign_key_checks = on')
開發者ID:OlegKlimenko,項目名稱:py-enarksh,代碼行數:18,代碼來源:Bootsrap.py


注:本文中的enarksh.DataLayer.DataLayer.execute_none方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。