Dockerized

This commit is contained in:
norohind committed 2023-11-28 19:00:10 +03:00
1 parent e3b8c724e3
commit f7f40738d0
9 files changed
+77 -3

No files matched your search

+1 -1
View File
@@ -207,4 +207,4 @@ class CAPIAuthorizer:
return self.model.list_all_records()
capi_authorizer = CAPIAuthorizer(model.Model())
capi_authorizer = CAPIAuthorizer(model.Model(config.db_location))
+2 -2
View File
@@ -8,8 +8,8 @@ logger = get_main_logger()
class Model:
def __init__(self):
self.db: sqlite3.Connection = sqlite3.connect('companion-api.sqlite', check_same_thread=False)
def __init__(self, db_location: str):
self.db: sqlite3.Connection = sqlite3.connect(db_location, check_same_thread=False)
self.db.row_factory = lambda c, r: dict(zip([col[0] for col in c.description], r))
with self.db:
self.db.execute(sqlite_requests.schema)