Put DB in WAL mode.

This commit is contained in:
Christian Speckner 2019-05-04 16:24:05 +02:00
parent 12409cc348
commit fd8b20290b
1 changed files with 5 additions and 0 deletions

View File

@ -74,6 +74,11 @@ void SqliteDatabase::initialize()
throw SqliteError("unable to initialize sqlite DB for unknown reason");
};
exec("PRAGMA journal_mode=WAL");
if (sqlite3_wal_checkpoint_v2(myHandle, nullptr, SQLITE_CHECKPOINT_TRUNCATE, nullptr, nullptr) != SQLITE_OK)
throw SqliteError(sqlite3_errmsg(myHandle));
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -