Making apsw return rows as MySQLdb does

connection = apsw.Connection(location)
connection.setrowtrace(row_factory)

def row_factory(cursor, row):
    columns = [t[0] for t in cursor.getdescription()]
    return dict(zip(columns, row))

Leave a Reply

Your email address will not be published.