Skip to content

Commit

Permalink
Add SQLite db pragma optimizations.
Browse files Browse the repository at this point in the history
  • Loading branch information
mblayman committed Dec 27, 2024
1 parent 6be726f commit 691af30
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion project/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,13 @@
"ENGINE": "django.db.backends.sqlite3",
"NAME": env.path("DB_DIR", BASE_DIR) / "db.sqlite3",
"OPTIONS": {
"init_command": "PRAGMA journal_mode=wal;",
"init_command": """
PRAGMA journal_mode=wal;
PRAGMA busy_timeout=5000;
PRAGMA synchronous=normal;
PRAGMA cache_size=-20000;
PRAGMA temp_store=memory;
""",
"transaction_mode": "IMMEDIATE",
},
}
Expand Down

0 comments on commit 691af30

Please sign in to comment.