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