예제 #1
0
    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)
예제 #2
0
    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)