sql row factory

This commit is contained in:
2019-03-11 07:51:05 +01:00
parent fa152f4d46
commit e3eaba33ed
5 changed files with 20 additions and 5 deletions

View File

@@ -1,5 +1,7 @@
import json
import sqlite3
from multiprocessing.pool import ThreadPool
from helpers import databaseHelper
with open("config.json", "r") as f:
config = json.load(f)
@@ -7,3 +9,8 @@ with open("config.json", "r") as f:
app = None
sql = None
pool = ThreadPool(config["threads"])
def new_sql():
db = sqlite3.connect("wayback.db")
db.row_factory = databaseHelper.dict_factory
return db