From 16b3f6c6245acf9689349dbd2af7d4411f861767 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Sun, 19 Jan 2025 00:21:11 +0100 Subject: Move sqlite database open/close to a new SQLiteDatabase. --- src/lib/exceptions.cc | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'src/lib/exceptions.cc') diff --git a/src/lib/exceptions.cc b/src/lib/exceptions.cc index 27496dcdc..5f0fe935a 100644 --- a/src/lib/exceptions.cc +++ b/src/lib/exceptions.cc @@ -19,8 +19,9 @@ */ -#include "exceptions.h" #include "compose.hpp" +#include "exceptions.h" +#include "sqlite_database.h" #include "i18n.h" @@ -180,3 +181,13 @@ DiskFullError::DiskFullError(boost::filesystem::path writing) } + +boost::filesystem::path +SQLError::get_filename(SQLiteDatabase& db) +{ + if (auto filename = sqlite3_db_filename(db.db(), "main")) { + return filename; + } + + return {}; +} -- cgit v1.2.3