File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -13,6 +13,10 @@ SqliteLogger::SqliteLogger(const Tree &tree,
1313
1414 db_ = std::make_unique<sqlite::Connection>(file.string ());
1515
16+ sqlite::Statement (*db_, " PRAGMA journal_mode=WAL;" );
17+ sqlite::Statement (*db_, " PRAGMA synchronous = normal;" );
18+ sqlite::Statement (*db_, " PRAGMA temp_store = memory;" );
19+
1620 sqlite::Statement (*db_,
1721 " CREATE TABLE IF NOT EXISTS Transitions ("
1822 " timestamp INTEGER PRIMARY KEY NOT NULL, "
@@ -27,8 +31,6 @@ SqliteLogger::SqliteLogger(const Tree &tree,
2731 " date TEXT NOT NULL,"
2832 " xml_tree TEXT NOT NULL);" );
2933
30- sqlite::Statement (*db_, " PRAGMA journal_mode=WAL;" );
31-
3234 if ( !append )
3335 {
3436 sqlite::Statement (*db_, " DELETE from Transitions;" );
@@ -56,6 +58,7 @@ SqliteLogger::~SqliteLogger()
5658 loop_ = false ;
5759 queue_push_cv_.notify_one ();
5860 queue_thread_.join ();
61+ sqlite::Statement (*db_, " PRAGMA optimize;" );
5962}
6063
6164void SqliteLogger::callback (Duration timestamp,
You can’t perform that action at this time.
0 commit comments