data: saving and loading Storage with sqlite file next to project file

This commit is contained in:
Eberhard Graether
2015-09-17 12:08:25 +02:00
parent f702b79892
commit a14bfaff56
12 changed files with 37 additions and 33 deletions
+7 -3
View File
@@ -7,7 +7,7 @@
SqliteStorage::SqliteStorage(const std::string& dbFilePath)
{
m_database.open(dbFilePath.c_str());
clear();
setup();
}
SqliteStorage::~SqliteStorage()
@@ -15,12 +15,16 @@ SqliteStorage::~SqliteStorage()
m_database.close();
}
void SqliteStorage::setup()
{
m_database.execDML("PRAGMA foreign_keys=ON;");
setupTables();
}
void SqliteStorage::clear()
{
m_database.execDML("PRAGMA foreign_keys=OFF;");
clearTables();
m_database.execDML("PRAGMA foreign_keys=ON;");
setupTables();
}
void SqliteStorage::beginTransaction()