Connect to SQLite using WAL mode

Significantely speeds up all database requests and should solve the dreaded "database is currently locked" issue that shows up from time to time
This commit is contained in:
Andy
2024-11-15 16:44:25 +01:00
committed by GitHub
parent 0bbd8a1828
commit 49ad9c30f2
@@ -40,6 +40,7 @@ class CustomSqliteConnection(sqlite3.Connection):
def __init__(self, *args, **kwargs): # real signature unknown
super().__init__(*args, **kwargs)
self.callbacks = []
self.execute("PRAGMA journal_mode=WAL;")
def execute_callbacks(self):
for callback in self.callbacks: