From a2ce4900a63f91f0cc685ac157762610c199c391 Mon Sep 17 00:00:00 2001 From: Jacob Walls Date: Tue, 3 Jun 2025 21:43:50 -0400 Subject: Fixed #36430 -- Removed artificially low limit on single field bulk operations on SQLite. --- django/db/backends/sqlite3/operations.py | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'django') diff --git a/django/db/backends/sqlite3/operations.py b/django/db/backends/sqlite3/operations.py index 2a5179755b..4a1693768c 100644 --- a/django/db/backends/sqlite3/operations.py +++ b/django/db/backends/sqlite3/operations.py @@ -32,9 +32,6 @@ class DatabaseOperations(BaseDatabaseOperations): """ SQLite has a variable limit defined by SQLITE_LIMIT_VARIABLE_NUMBER (reflected in max_query_params). - - If there's only a single field to insert, the limit is 500 - (SQLITE_MAX_COMPOUND_SELECT). """ fields = list( chain.from_iterable( @@ -46,9 +43,7 @@ class DatabaseOperations(BaseDatabaseOperations): for field in fields ) ) - if len(fields) == 1: - return 500 - elif len(fields) > 1: + if fields: return self.connection.features.max_query_params // len(fields) else: return len(objs) -- cgit v1.3