From 3565aad630864ecdbe53fdaa501ea708555b3c7c Mon Sep 17 00:00:00 2001 From: Unit 193 Date: Sun, 30 Apr 2023 18:30:36 -0400 Subject: New upstream version 3.4.4+dfsg. --- SQLiteStudio3/coreSQLiteStudio/db/abstractdb.h | 35 ++++++++++++++++++++++++-- 1 file changed, 33 insertions(+), 2 deletions(-) (limited to 'SQLiteStudio3/coreSQLiteStudio/db/abstractdb.h') diff --git a/SQLiteStudio3/coreSQLiteStudio/db/abstractdb.h b/SQLiteStudio3/coreSQLiteStudio/db/abstractdb.h index a465679..193f173 100644 --- a/SQLiteStudio3/coreSQLiteStudio/db/abstractdb.h +++ b/SQLiteStudio3/coreSQLiteStudio/db/abstractdb.h @@ -203,6 +203,8 @@ class API_EXPORT AbstractDb : public Db virtual void initAfterOpen(); + virtual bool flushWalInternal() = 0; + void checkForDroppedObject(const QString& query); bool registerCollation(const QString& name); bool deregisterCollation(const QString& name); @@ -341,6 +343,16 @@ class API_EXPORT AbstractDb : public Db * @brief Function type. */ FunctionManager::ScriptFunction::Type type; + + /** + * @brief The deterministic flag used for function registration. + */ + bool deterministic; + + /** + * @brief Flag indicating if this function is SQLiteStudio's built-in function or user's custom function. + */ + bool builtIn = false; }; friend int qHash(const AbstractDb::RegisteredFunction& fn); @@ -414,6 +426,23 @@ class API_EXPORT AbstractDb : public Db */ void registerFunction(const RegisteredFunction& function); + /** + * @brief Flushes any pending WAL log files into the db file. + * + * It actually makes a 'PRAGMA wal_checkpoint(FULL)' call on the database. + * It's called automatically upon closing the database. + */ + void flushWal(); + + /** + * @brief Registers SQLiteStudio's built-in functions in the db. + * + * This function is called once during opening the db. + * + * @see FunctionManager + */ + void registerBuiltInFunctions(); + /** * @brief Connection state lock. * @@ -457,14 +486,16 @@ class API_EXPORT AbstractDb : public Db */ void asyncQueryFinished(AsyncQueryRunner* runner); + void appIsAboutToQuit(); + public slots: bool open(); bool close(); bool openQuiet(); bool closeQuiet(); bool openForProbing(); - void registerAllFunctions(); - void registerAllCollations(); + void registerUserFunctions(); + void registerUserCollations(); void reloadExtensions(); }; -- cgit v1.2.3