aboutsummaryrefslogtreecommitdiffstats
path: root/SQLiteStudio3/coreSQLiteStudio/db/abstractdb.h
diff options
context:
space:
mode:
authorLibravatarUnit 193 <unit193@unit193.net>2023-04-30 18:31:18 -0400
committerLibravatarUnit 193 <unit193@unit193.net>2023-04-30 18:31:18 -0400
commit4de57f628bc74f00ba1885e91c84ea07c5405d8f (patch)
tree5d91900751e826d491ff1b2ebc571a787e84f864 /SQLiteStudio3/coreSQLiteStudio/db/abstractdb.h
parent74d881cefa9097e58e129e37b9c44d680d8c7dfe (diff)
parent3565aad630864ecdbe53fdaa501ea708555b3c7c (diff)
Update upstream source from tag 'upstream/3.4.4+dfsg'
Update to upstream version '3.4.4+dfsg' with Debian dir 482614bd23f0ef52dabc9803477204ad88e917ed
Diffstat (limited to 'SQLiteStudio3/coreSQLiteStudio/db/abstractdb.h')
-rw-r--r--SQLiteStudio3/coreSQLiteStudio/db/abstractdb.h35
1 files changed, 33 insertions, 2 deletions
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);
@@ -415,6 +427,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.
*
* It's locked whenever the connection state is changed or tested.
@@ -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();
};