enable sqlite WAL mode

This commit is contained in:
Shroominic
2025-10-18 13:18:59 +08:00
parent 8d9c9d93eb
commit 8960501f6b
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)