From 853c0927c5dda9d5f543dd73eeb718149aec9d2d Mon Sep 17 00:00:00 2001 From: Stephen Anthony Date: Sun, 18 Dec 2022 21:18:56 -0330 Subject: [PATCH] Default to using system-wide libsqlite3 on Linux/UNIX systems. Fix for slow exit from app in this mode is now fixed. --- configure | 8 +++----- src/common/repository/sqlite/SqliteDatabase.cxx | 1 + 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/configure b/configure index ce0bca493..1dc8777c9 100755 --- a/configure +++ b/configure @@ -207,7 +207,6 @@ Optional Features: --disable-png --enable-zip enable/disable ZIP file support [enabled] --disable-zip - --use-system-sqlite use libsqlite3 installed on system [disabled] --enable-windowed enable/disable windowed rendering modes [enabled] --disable-windowed --enable-shared build shared binary [enabled] @@ -254,7 +253,6 @@ for ac_option in $@; do --disable-png) _build_png=no ;; --enable-zip) _build_zip=yes ;; --disable-zip) _build_zip=no ;; - --use-system-sqlite) _build_sqlite3=no ;; --enable-windowed) _build_windowed=yes ;; --disable-windowed) _build_windowed=no ;; --enable-shared) _build_static=no ;; @@ -665,9 +663,9 @@ fi # # Check for sqlite3 # -_libsqlite3=no echocheck "libsqlite3" -if test "$_build_sqlite3" = no ; then +if test "$_build_sqlite3" = yes ; then + _libsqlite3=no cat > $TMPC << EOF #include #include @@ -676,7 +674,7 @@ EOF cc_check $LDFLAGS $CXXFLAGS `pkg-config --libs sqlite3` && _libsqlite3=yes if test "$_libsqlite3" = yes ; then - echo "$_libsqlite3 (WIP, not complete)" + echo "$_libsqlite3" else echo "built-in" _build_sqlite3=yes diff --git a/src/common/repository/sqlite/SqliteDatabase.cxx b/src/common/repository/sqlite/SqliteDatabase.cxx index b761a5325..413b3b570 100644 --- a/src/common/repository/sqlite/SqliteDatabase.cxx +++ b/src/common/repository/sqlite/SqliteDatabase.cxx @@ -70,6 +70,7 @@ void SqliteDatabase::initialize() } exec("PRAGMA journal_mode=WAL"); + exec("PRAGMA synchronous=1"); switch (sqlite3_wal_checkpoint_v2(myHandle, nullptr, SQLITE_CHECKPOINT_TRUNCATE, nullptr, nullptr)) { case SQLITE_OK: