From 2128a73713735fb794ca6565fd5d7792293f5cfa Mon Sep 17 00:00:00 2001 From: David Sanders Date: Fri, 22 Sep 2023 19:27:58 +1000 Subject: [PATCH] Refs #34825 -- Made SQLite backend open source database in readonly mode when using spawn. --- django/db/backends/sqlite3/creation.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/django/db/backends/sqlite3/creation.py b/django/db/backends/sqlite3/creation.py index a9fd520b2d..802e8b8357 100644 --- a/django/db/backends/sqlite3/creation.py +++ b/django/db/backends/sqlite3/creation.py @@ -143,7 +143,7 @@ class DatabaseCreation(BaseDatabaseCreation): f"file:memorydb_{alias}_{_worker_id}?mode=memory&cache=shared" ) source_db = self.connection.Database.connect( - f"file:{alias}_{_worker_id}.sqlite3", uri=True + f"file:{alias}_{_worker_id}.sqlite3?mode=ro", uri=True ) target_db = sqlite3.connect(connection_str, uri=True) source_db.backup(target_db)