Commit 51f1ce78 authored by Marco Bubke's avatar Marco Bubke

Sqlite: Add journal option to database constructor

Makes tests much easier.

Change-Id: I8b5892ff0deb2e22ac0e874dda0d8d20a32fd2e6
Reviewed-by: Tim Jenssen's avatarTim Jenssen <tim.jenssen@qt.io>
parent 2a410312
...@@ -35,9 +35,10 @@ Database::Database() ...@@ -35,9 +35,10 @@ Database::Database()
{ {
} }
Database::Database(Utils::PathString &&databaseFilePath) Database::Database(Utils::PathString &&databaseFilePath, JournalMode journalMode)
: m_databaseBackend(*this) : m_databaseBackend(*this)
{ {
setJournalMode(journalMode);
open(std::move(databaseFilePath)); open(std::move(databaseFilePath));
} }
...@@ -128,4 +129,6 @@ DatabaseBackend &Database::backend() ...@@ -128,4 +129,6 @@ DatabaseBackend &Database::backend()
return m_databaseBackend; return m_databaseBackend;
} }
} // namespace Sqlite } // namespace Sqlite
...@@ -47,7 +47,7 @@ public: ...@@ -47,7 +47,7 @@ public:
using MutexType = std::mutex; using MutexType = std::mutex;
Database(); Database();
Database(Utils::PathString &&databaseFilePath); Database(Utils::PathString &&databaseFilePath, JournalMode journalMode=JournalMode::Wal);
Database(const Database &) = delete; Database(const Database &) = delete;
bool operator=(const Database &) = delete; bool operator=(const Database &) = delete;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment