19 #ifndef KompexSQLiteDatabase_H
20 #define KompexSQLiteDatabase_H
78 SQLiteDatabase(
const std::string &filename,
int flags,
const char *zVfs);
107 void Open(
const char *filename,
int flags,
const char *zVfs);
128 void Open(
const std::string &filename,
int flags,
const char *zVfs);
133 void Open(
const wchar_t *filename);
186 inline int ReleaseMemory(
int bytesOfMemory)
const {
return sqlite3_release_memory(bytesOfMemory);}
204 void MoveDatabaseToMemory(UtfEncoding encoding =
UTF8);
209 void SaveDatabaseFromMemoryToFile(
const std::string &filename =
"");
212 void SaveDatabaseFromMemoryToFile(
const wchar_t *filename);
225 bool IsDatabaseReadOnly();
244 void CreateModule(
const std::string &moduleName,
const sqlite3_module *module,
void *clientData,
void(*xDestroy)(
void*));
247 int GetNumberOfCheckedOutLookasideMemorySlots()
const;
249 int GetHeapMemoryUsedByPagerCaches()
const;
254 int GetHeapMemoryUsedToStoreSchemas()
const;
257 int GetHeapAndLookasideMemoryUsedByPreparedStatements()
const;
259 int GetPagerCacheHitCount()
const;
261 int GetPagerCacheMissCount()
const;
268 int GetNumberOfDirtyCacheEntries()
const;
270 int GetNumberOfUnresolvedForeignKeys()
const;
274 int GetHighestNumberOfCheckedOutLookasideMemorySlots(
bool resetValue =
false);
277 int GetLookasideMemoryHitCount(
bool resetValue =
false);
281 int GetLookasideMemoryMissCountDueToSmallSlotSize(
bool resetValue =
false);
285 int GetLookasideMemoryMissCountDueToFullMemory(
bool resetValue =
false);
289 static void TraceOutput(
void *ptr,
const char *sql);
291 static void ProfileOutput(
void* ptr,
const char* sql, sqlite3_uint64 time);
293 static int ProcessDDLRow(
void *db,
int nColumns,
char **values,
char **columns);
295 static int ProcessDMLRow(
void *db,
int nColumns,
char **values,
char **columns);
297 void TakeSnapshot(sqlite3 *destinationDatabase);
299 int GetRuntimeStatusInformation(
int operation,
bool highwaterValue =
false,
bool resetFlag =
false)
const;
312 void CleanUpFailedMemoryDatabase(sqlite3 *memoryDatabase, sqlite3 *rollbackDatabase,
bool isDetachNecessary,
bool isRollbackNecessary, sqlite3_stmt *stmt,
const std::string &errMsg,
int internalSqliteErrCode);
318 #endif // KompexSQLiteDatabase_H
void ActivateTracing() const
Definition: KompexSQLiteDatabase.h:163
Definition: KompexSQLiteStatement.h:35
struct sqlite3 * mDatabaseHandle
SQLite db handle.
Definition: KompexSQLiteDatabase.h:303
void SetSoftHeapLimit(int heapLimit) const
Definition: KompexSQLiteDatabase.h:179
long long GetLastInsertRowId() const
Definition: KompexSQLiteDatabase.h:221
void InterruptDatabaseOperation() const
Definition: KompexSQLiteDatabase.h:154
static void ProfileOutput(void *ptr, const char *sql, sqlite3_uint64 time)
Callback function for ActivateProfiling() [sqlite3_profile].
Definition: KompexSQLiteDatabase.cpp:136
std::string mDatabaseFilenameUtf8
Database filename UTF-8.
Definition: KompexSQLiteDatabase.h:305
Administration of the database and all concerning settings.
Definition: KompexSQLiteDatabase.h:31
static void TraceOutput(void *ptr, const char *sql)
Callback function for ActivateTracing() [sqlite3_trace].
Definition: KompexSQLiteDatabase.cpp:131
long long GetMemoryUsage() const
GetMemoryUsed() returns the number of bytes of memory currently outstanding (malloced but not freed)...
Definition: KompexSQLiteDatabase.h:189
long long GetMemoryHighwaterMark(bool resetFlag=false) const
Definition: KompexSQLiteDatabase.h:194
int GetTotalDatabaseChanges() const
Definition: KompexSQLiteDatabase.h:150
int GetLibVersionNumber() const
Returns the version number of sqlite.
Definition: KompexSQLiteDatabase.h:141
#define _SQLiteWrapperExport
Definition: KompexSQLitePrerequisites.h:32
Definition: KompexSQLiteStatement.h:38
int GetDatabaseChanges() const
Definition: KompexSQLiteDatabase.h:144
int GetAutoCommit() const
Definition: KompexSQLiteDatabase.h:158
std::wstring mDatabaseFilenameUtf16
Database filename UTF-16.
Definition: KompexSQLiteDatabase.h:307
sqlite3 * GetDatabaseHandle() const
Returns the SQLite db handle.
Definition: KompexSQLiteDatabase.h:139
int ReleaseMemory(int bytesOfMemory) const
Definition: KompexSQLiteDatabase.h:186
void ActivateProfiling() const
Definition: KompexSQLiteDatabase.h:169
UtfEncoding
Provided encodings for MoveDatabaseToMemory().
Definition: KompexSQLiteDatabase.h:197
void ReleaseMemory()
This function attempts to free as much heap memory as possible from the database connection.
Definition: KompexSQLiteDatabase.h:228
Definition: KompexSQLiteBlob.h:26
bool mIsMemoryDatabaseActive
Is the database currently stored in memory?
Definition: KompexSQLiteDatabase.h:309