mirror of
https://mau.dev/maunium/synapse.git
synced 2024-12-14 18:53:53 +01:00
Enable WAL for SQLite (#13897)
Signed-off-by: Lorenzo Manacorda <lorenzo@mailbox.org>
This commit is contained in:
parent
19c0e55ef7
commit
8c94dd3a27
2 changed files with 5 additions and 0 deletions
1
changelog.d/13897.feature
Normal file
1
changelog.d/13897.feature
Normal file
|
@ -0,0 +1 @@
|
|||
Enable Write-Ahead Logging for SQLite installs. Contributed by [asymmetric](https://github.com/asymmetric).
|
|
@ -88,6 +88,10 @@ class Sqlite3Engine(BaseDatabaseEngine[sqlite3.Connection, sqlite3.Cursor]):
|
|||
|
||||
db_conn.create_function("rank", 1, _rank)
|
||||
db_conn.execute("PRAGMA foreign_keys = ON;")
|
||||
|
||||
# Enable WAL.
|
||||
# see https://www.sqlite.org/wal.html
|
||||
db_conn.execute("PRAGMA journal_mode = WAL;")
|
||||
db_conn.commit()
|
||||
|
||||
def is_deadlock(self, error: Exception) -> bool:
|
||||
|
|
Loading…
Reference in a new issue