File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -117,6 +117,7 @@ def __init__(
117117 def _add_missing_pragmas (init_commands : list [str ]) -> list [str ]:
118118 has_foreign_keys = False
119119 has_journal_mode = False
120+ has_synchronous = False
120121 has_busy_timeout = False
121122 for cmd in init_commands :
122123 if "PRAGMA" not in cmd :
@@ -125,12 +126,16 @@ def _add_missing_pragmas(init_commands: list[str]) -> list[str]:
125126 has_foreign_keys = True
126127 elif "journal_mode" in cmd :
127128 has_journal_mode = True
129+ elif "synchronous" in cmd :
130+ has_synchronous = True
128131 elif "busy_timeout" in cmd :
129132 has_busy_timeout = True
130133 if not has_foreign_keys :
131134 init_commands .append ("PRAGMA foreign_keys = ON" )
132135 if not has_journal_mode :
133136 init_commands .append ("PRAGMA journal_mode = WAL" )
137+ if not has_synchronous :
138+ init_commands .append ("PRAGMA synchronous = NORMAL" )
134139 if not has_busy_timeout :
135140 init_commands .append ("PRAGMA busy_timeout = 5000" )
136141 return init_commands
You can’t perform that action at this time.
0 commit comments