Minor bug fixes.

This commit is contained in:
Landon Wark
2023-12-07 12:50:03 -06:00
parent cbf36a5b0b
commit 0dd51827a0
22 changed files with 308 additions and 370 deletions

View File

@@ -1,5 +1,21 @@
'''
All database related operations.
'''
from .functions import *
from .models import *
from sqlalchemy import event
from sqlalchemy.engine import Engine
@event.listens_for(Engine, "connect")
def set_sqlite_pragma(dbapi_connection, connection_record):
"""
*should* allow automatic creation of foreign keys in the database
I have no idea how it actually works.
Args:
dbapi_connection (_type_): _description_
connection_record (_type_): _description_
"""
cursor = dbapi_connection.cursor()
cursor.execute("PRAGMA foreign_keys=ON")
cursor.close()
from .models import *