From e39e2d4c49994fa9e4e765804d8907d101c851f0 Mon Sep 17 00:00:00 2001 From: Simon Quigley Date: Sat, 25 Jan 2025 23:03:27 -0600 Subject: [PATCH] Always consolidate the WAL file and VACUUM to start --- cpp/db_common.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cpp/db_common.cpp b/cpp/db_common.cpp index 42de350..a7dda46 100644 --- a/cpp/db_common.cpp +++ b/cpp/db_common.cpp @@ -84,6 +84,8 @@ bool init_database(const QString& database_path) { ci_query_exec(&pragma_query, "PRAGMA journal_mode = WAL;"); ci_query_exec(&pragma_query, "PRAGMA synchronous = NORMAL;"); ci_query_exec(&pragma_query, "PRAGMA foreign_keys = ON;"); + ci_query_exec(&pragma_query, "PRAGMA wal_checkpoint(TRUNCATE);"); + ci_query_exec(&pragma_query, "VACUUM;"); } // Run the schema creation (or migration) statements