aboutsummaryrefslogtreecommitdiff
path: root/src/Database
diff options
context:
space:
mode:
Diffstat (limited to 'src/Database')
-rw-r--r--src/Database/initdatabase.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/Database/initdatabase.cpp b/src/Database/initdatabase.cpp
index c3b4823..fb99dfa 100644
--- a/src/Database/initdatabase.cpp
+++ b/src/Database/initdatabase.cpp
@@ -14,9 +14,10 @@ bool initDatabase(const QString applicationPath)
return false;
}
- // speed up SQLite with keeping journals in memory and asynchronous writing
+ // SQLite tweaks with async, wal and timeout
dbi.exec("PRAGMA synchronous = OFF");
- dbi.exec("PRAGMA journal_mode = MEMORY");
+ dbi.exec("PRAGMA journal_mode = WAL"); // previous: MEMORY
+ dbi.exec("PRAGMA busy_timeout = 500"); // 500ms
{ // check if the database was generated with this version of the software