Пример #1
0
 def execute_select(self, query, data=None):
     """
     Yet another wrapper around queries
     """
     db = Connect(**self.config.superuser_dbinfo().copy())
     cursor = db.cursor()
     cursor.execute(query, data)
     yield cursor.fetchall()
     db.close()
Пример #2
0
 def _ddl_command(self, query, params=None):
     config = self.config.superuser_dbinfo().copy()
     del(config['database'])
     db = Connect(**config)
     cursor = db.cursor()
     cursor.execute(query, params)
     db.commit()
     db.close()
Пример #3
0
 def execute_instruction(self, query, data=None):
     """
     Yet another wrapper around execute
     """
     db = Connect(**self.config.superuser_dbinfo().copy())
     cursor = db.cursor()
     cursor.execute(query, data)
     db.commit()
     db.close()
     return cursor