Ensure foreign key constraints are always enforced

This commit is contained in:
2025-12-27 00:21:22 +01:00
parent 4becbcdea3
commit 7525d2b2ed

View File

@@ -20,6 +20,7 @@ def get_db() -> Generator[sqlite3.Connection, None, None]:
"""Get a database connection context manager."""
conn = sqlite3.connect(settings.database_path)
conn.row_factory = sqlite3.Row # Enable dict-like access to rows
conn.execute("PRAGMA foreign_keys = ON")
try:
yield conn
finally: