1
0
mirror of https://github.com/django/django.git synced 2024-12-22 17:16:24 +00:00

Refs #34825 -- Made SQLite backend open source database in readonly mode when using spawn.

This commit is contained in:
David Sanders 2023-09-22 19:27:58 +10:00 committed by Mariusz Felisiak
parent a5905b164d
commit 2128a73713

View File

@ -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)