aboutsummaryrefslogtreecommitdiffstats
path: root/SQLiteStudio3/coreSQLiteStudio/db/abstractdb.h
diff options
context:
space:
mode:
authorLibravatarUnit 193 <unit193@unit193.net>2023-04-30 18:30:36 -0400
committerLibravatarUnit 193 <unit193@unit193.net>2023-04-30 18:30:36 -0400
commit3565aad630864ecdbe53fdaa501ea708555b3c7c (patch)
treec743e4ad0bad39ebdb2f514c7cc52d34a257ebbe /SQLiteStudio3/coreSQLiteStudio/db/abstractdb.h
parent1fdc150116cad39aae5c5da407c3312b47a59e3a (diff)
New upstream version 3.4.4+dfsg.upstream/3.4.4+dfsg
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();
};