Merge pull request #34494 from tanmoysrt/sqlite_fix

fix(sqlite): Use DEFERRED isolation level
This commit is contained in:
Akhil Narang 2025-10-28 14:09:59 +05:30 committed by GitHub
commit 139ae9ef6c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -105,12 +105,12 @@ class SQLiteDatabase(SQLiteExceptionUtil, Database):
def get_connection(self, read_only: bool = False):
conn = self.create_connection(read_only)
conn.isolation_level = None
conn.create_function("regexp", 2, regexp)
conn.create_function("regexp_replace", 3, regexp_replace)
pragmas = {
"journal_mode": "WAL",
"synchronous": "NORMAL",
"busy_timeout": 5000, # in milliseconds
}
cursor = conn.cursor()
for pragma, value in pragmas.items():