def customQuery(self, sql, tables): sqlLog.append(sql) connection = sqlite3.connect(TRANSCRIPT) cursor = connection.cursor() sqlArray = sql.split(";\n") for sqlStatement in sqlArray: cursor.execute(sqlStatement) connection.commit() return self._mapResults(cursor.fetchall(), tables)
def execute(self, queryName): sql = queries[queryName]["sql"] tables = queries[queryName]["tables"] sqlLog.append(sql) connection = sqlite3.connect(TRANSCRIPT) cursor = connection.cursor() sqlArray = sql.split(";\n") for sqlStatement in sqlArray: cursor.execute(sqlStatement) connection.commit() return self._mapResults(cursor.fetchall(), tables)