Remove unnecessary dict factory for database.

This commit is contained in:
Labrys of Knossos 2019-04-08 19:23:21 -04:00
commit d3bbcb6b63

View file

@ -37,10 +37,7 @@ class DBConnection(object):
self.filename = filename
self.connection = sqlite3.connect(db_filename(filename), 20)
if row_type == 'dict':
self.connection.row_factory = self._dict_factory
else:
self.connection.row_factory = sqlite3.Row
self.connection.row_factory = sqlite3.Row
def check_db_version(self):
result = None
@ -214,13 +211,6 @@ class DBConnection(object):
for column in cursor
}
# http://stackoverflow.com/questions/3300464/how-can-i-get-dict-from-sqlite-query
def _dict_factory(self, cursor, row):
return {
col[0]: row[idx]
for idx, col in enumerate(cursor.description)
}
def sanity_check_database(connection, sanity_check):
sanity_check(connection).check()