enable sqlite WAL mode

This commit is contained in:
Shroominic
2025-10-16 11:00:52 +08:00
parent c56a06f3df
commit 7e6e0f806b
2 changed files with 4 additions and 0 deletions
+2
View File
@@ -12,6 +12,8 @@ dist/
# Development
.notes
.*keys.db
*.db-shm
*.db-wal
.*wallet.sqlite3
*models.json
.cashu
+2
View File
@@ -79,6 +79,8 @@ async def balances_for_mint_and_unit(
async def init_db() -> None:
"""Initializes the database and creates tables if they don't exist."""
async with engine.begin() as conn:
if DATABASE_URL.startswith("sqlite"):
await conn.exec_driver_sql("PRAGMA journal_mode=WAL")
await conn.run_sync(SQLModel.metadata.create_all)