fix: db revamp, add relations, annotate the db

also allows for request retrieval, and adds decorator for authed access
This commit is contained in:
2025-05-27 01:28:40 +02:00
parent 00a30695b7
commit 4893715118
5 changed files with 139 additions and 80 deletions

View File

@@ -2,8 +2,9 @@ from git import Repo # hash ostatniego commitu
import os
import time
import toml
import lewy_db
global config, randomly_generated_passcode
global db, config, randomly_generated_passcode
class colors:
HEADER = '\033[95m'
@@ -81,6 +82,14 @@ def getConfig(configfile):
else:
return toml.load(configfile)
def setupDb(app, config):
global db
db = lewy_db.initDB(app, config)
return db
def getDb():
return db
def setConfig(configfile):
global config
config = getConfig(configfile)