Rev1905, Secure DB write db_mode option
This commit is contained in:
parent
3d55af2111
commit
f5fb6b83ff
2 changed files with 8 additions and 4 deletions
|
@ -59,9 +59,12 @@ class Db(object):
|
|||
self.conn.row_factory = sqlite3.Row
|
||||
self.conn.isolation_level = None
|
||||
self.cur = self.getCursor()
|
||||
# We need more speed then security
|
||||
self.cur.execute("PRAGMA journal_mode = MEMORY")
|
||||
self.cur.execute("PRAGMA synchronous = OFF")
|
||||
if config.db_mode == "security":
|
||||
self.cur.execute("PRAGMA journal_mode = WAL")
|
||||
self.cur.execute("PRAGMA synchronous = NORMAL")
|
||||
else:
|
||||
self.cur.execute("PRAGMA journal_mode = MEMORY")
|
||||
self.cur.execute("PRAGMA synchronous = OFF")
|
||||
if self.foreign_keys:
|
||||
self.execute("PRAGMA foreign_keys = ON")
|
||||
self.log.debug(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue