From c902f12ea4c192d74cf3bfad0589d22899581350 Mon Sep 17 00:00:00 2001 From: quotentiroler Date: Wed, 30 Sep 2026 12:58:55 +0200 Subject: [PATCH] Build the fixture database in one transaction --- datasette/fixtures.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/datasette/fixtures.py b/datasette/fixtures.py index 049e35ed..a9639c0d 100644 --- a/datasette/fixtures.py +++ b/datasette/fixtures.py @@ -385,7 +385,8 @@ INSERT INTO "searchable_fts" (rowid, text1, text2) @documented(label="datasette_fixtures_populate_fixture_database") def populate_fixture_database(conn): """Populate a SQLite connection with Datasette's test fixture tables.""" - conn.executescript(TABLES) + # TABLES is ~1,440 INSERTs; without a wrapping transaction each one commits on its own. + conn.executescript("BEGIN;" + TABLES + "COMMIT;") for sql, params in TABLE_PARAMETERIZED_SQL: with conn: conn.execute(sql, params)