db config

This commit is contained in:
Nicolás Sánchez 2026-06-05 19:55:58 -03:00
parent 097a4bff51
commit 9a77c1a36f
1 changed files with 2 additions and 0 deletions

View File

@ -19,6 +19,8 @@ def get_db_connection():
if not hasattr(_local_storage, 'connection'):
_local_storage.connection = sqlite3.connect(profits_database, check_same_thread=False)
_local_storage.connection.row_factory = sqlite3.Row
_local_storage.connection.execute("PRAGMA journal_mode=WAL")
_local_storage.connection.execute("PRAGMA synchronous=NORMAL")
_local_storage.created_at = current_time
return _local_storage.connection