From 8e1fdbe10862ccba3bdff2389c1bb732c6e84da4 Mon Sep 17 00:00:00 2001 From: Darkelarious Date: Sun, 4 May 2025 16:08:07 +0200 Subject: database pragmas and timeout restraints --- src/Database/initdatabase.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/Database/initdatabase.cpp') 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 -- cgit v1.2.3