Skip to content
Snippets Groups Projects
Commit 476987ed authored by Philipp Hörist's avatar Philipp Hörist
Browse files

Optimize write operations to DB

parent 086d8b9e
No related branches found
No related tags found
No related merge requests found
......@@ -27,6 +27,13 @@ class SQLDatabase():
:type dbConn: Connection
"""
self.dbConn = dbConn
c = self.dbConn.cursor()
c.execute("PRAGMA synchronous=NORMAL;")
c.execute("PRAGMA journal_mode;")
mode = c.fetchone()[0]
# WAL is a persistent DB mode, dont override it if user has set it
if mode != 'wal':
c.execute("PRAGMA journal_mode=MEMORY;")
self.createDb()
self.migrateDb()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment