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()
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()
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