diff roundup/backends/back_sqlite.py @ 6930:a96a239db0d9

Set all sqlite db's to WAL mode on creation Complete work done on 6917:fba76e0bba98. WAL journaling mode now enabled on primary db as well as session db's when using sqlite for session databases. Made change to WAL mode more robust for testing by bracketing `pragma journal_mode=wal` with commit() calls. Normally the conversion would occur when a new session was opened, but this commits the changes explicitly to make all the tests stable. Also added doc on this.
author John Rouillard <rouilj@ieee.org>
date Thu, 08 Sep 2022 01:12:12 -0400
parents fba76e0bba98
children ff7f6c0bbdae
line wrap: on
line diff
--- a/roundup/backends/back_sqlite.py	Wed Sep 07 10:55:31 2022 -0400
+++ b/roundup/backends/back_sqlite.py	Thu Sep 08 01:12:12 2022 -0400
@@ -204,7 +204,9 @@
             self.create_version_2_tables()
             self._add_fts5_table()
             # Set journal mode to WAL.
-            self.conn.execute('pragma journal_mode=wal')
+            self.sql_commit()  # close out rollback journal/transaction
+            self.sql('pragma journal_mode=wal')  # set wal
+            self.sql_commit()  # close out rollback and commit wal change
 
     def create_version_2_tables(self):
         self.sql('create table otks (otk_key varchar, '

Roundup Issue Tracker: http://roundup-tracker.org/