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,
13
13
14
14
db_ = std::make_unique<sqlite::Connection>(file.string ());
15
15
16
+ sqlite::Statement (*db_, " PRAGMA journal_mode=WAL;" );
17
+ sqlite::Statement (*db_, " PRAGMA synchronous = normal;" );
18
+ sqlite::Statement (*db_, " PRAGMA temp_store = memory;" );
19
+
16
20
sqlite::Statement (*db_,
17
21
" CREATE TABLE IF NOT EXISTS Transitions ("
18
22
" timestamp INTEGER PRIMARY KEY NOT NULL, "
@@ -27,8 +31,6 @@ SqliteLogger::SqliteLogger(const Tree &tree,
27
31
" date TEXT NOT NULL,"
28
32
" xml_tree TEXT NOT NULL);" );
29
33
30
- sqlite::Statement (*db_, " PRAGMA journal_mode=WAL;" );
31
-
32
34
if ( !append )
33
35
{
34
36
sqlite::Statement (*db_, " DELETE from Transitions;" );
@@ -56,6 +58,7 @@ SqliteLogger::~SqliteLogger()
56
58
loop_ = false ;
57
59
queue_push_cv_.notify_one ();
58
60
queue_thread_.join ();
61
+ sqlite::Statement (*db_, " PRAGMA optimize;" );
59
62
}
60
63
61
64
void SqliteLogger::callback (Duration timestamp,
You can’t perform that action at this time.
0 commit comments