diff --git a/headphones/db.py b/headphones/db.py index 601b6286..a1f1d96d 100644 --- a/headphones/db.py +++ b/headphones/db.py @@ -40,6 +40,12 @@ class DBConnection: self.filename = filename self.connection = sqlite3.connect(dbFilename(filename), timeout=20) + #don't wait for the disk to finish writing + self.connection.execute("PRAGMA synchronous = OFF") + #journal disabled since we never do rollbacks + self.connection.execute("PRAGMA journal_mode = OFF") + #64mb of cache memory,probably need to make it user configurable + self.connection.execute("PRAGMA cache_size=-65536") self.connection.row_factory = sqlite3.Row def action(self, query, args=None):