forked from qt-creator/qt-creator
Sqlite: Add Read and ReadWrite mode to database
We want open databases in read only mode too. Change-Id: I3b20602d4bd7841c9fca3260edce082d21022052 Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
This commit is contained in:
@@ -54,7 +54,7 @@ public:
|
||||
void shutdownSqliteLibrary();
|
||||
void checkpointFullWalLog();
|
||||
|
||||
void open(Utils::SmallStringView databaseFilePath);
|
||||
void open(Utils::SmallStringView databaseFilePath, OpenMode openMode);
|
||||
void close();
|
||||
void closeWithoutException();
|
||||
|
||||
@@ -76,6 +76,8 @@ public:
|
||||
template <typename Type>
|
||||
Type toValue(Utils::SmallStringView sqlStatement);
|
||||
|
||||
static int openMode(OpenMode);
|
||||
|
||||
protected:
|
||||
bool databaseIsOpen() const;
|
||||
|
||||
@@ -106,9 +108,11 @@ protected:
|
||||
Utils::SmallStringView textEncodingToPragma(TextEncoding textEncoding);
|
||||
static TextEncoding pragmaToTextEncoding(Utils::SmallStringView pragma);
|
||||
|
||||
|
||||
Q_NORETURN static void throwExceptionStatic(const char *whatHasHappens);
|
||||
Q_NORETURN void throwException(const char *whatHasHappens) const;
|
||||
|
||||
|
||||
private:
|
||||
SqliteDatabase &m_database;
|
||||
sqlite3 *m_databaseHandle;
|
||||
|
||||
Reference in New Issue
Block a user