[core] expose an option to change the db file path in runtime

This commit is contained in:
Łukasz Paczos
2019-02-19 13:22:24 +01:00
committed by Łukasz Paczos
parent 5e58a0d81d
commit 3f7b70fdb0
6 changed files with 45 additions and 11 deletions

View File

@@ -1352,3 +1352,11 @@ TEST(OfflineDatabase, TEST_REQUIRES_WRITE(MergeDatabaseWithDiskFull)) {
}
#endif // __QT__
TEST(OfflineDatabse, ChangePath) {
std::string newPath("test/fixtures/offline_database/test.db");
OfflineDatabase db(":memory:");
db.changePath(newPath);
mapbox::sqlite::Database::open(newPath, mapbox::sqlite::ReadOnly);
util::deleteFile(newPath);
}