From b3a1e4acb5ebafed0aef17664fd95621c6cb8154 Mon Sep 17 00:00:00 2001 From: abraunegg Date: Wed, 25 Oct 2023 09:14:46 +1100 Subject: [PATCH] Add debug output to determine DB access threadsafe value * Add debug output to determine DB access threadsafe value --- src/itemdb.d | 5 +++++ src/sqlite.d | 6 ++++++ 2 files changed, 11 insertions(+) diff --git a/src/itemdb.d b/src/itemdb.d index f1663a0d8..ed587c258 100644 --- a/src/itemdb.d +++ b/src/itemdb.d @@ -203,6 +203,11 @@ final class ItemDatabase { db.exec("DROP TABLE item"); createTable(); } + + // What is the threadsafe value + auto threadsafeValue = db.getThreadsafeValue(); + log.vdebug("Threadsafe database value: ", threadsafeValue); + // Set the enforcement of foreign key constraints. // https://www.sqlite.org/pragma.html#pragma_foreign_keys // PRAGMA foreign_keys = boolean; diff --git a/src/sqlite.d b/src/sqlite.d index 97e39289d..8ed42fe5c 100644 --- a/src/sqlite.d +++ b/src/sqlite.d @@ -101,6 +101,12 @@ struct Database { } return userVersion; } + + int getThreadsafeValue() { + // Get the threadsafe value + auto threadsafeValue = sqlite3_threadsafe(); + return threadsafeValue; + } string getErrorMessage() { return ifromStringz(sqlite3_errmsg(pDb));