diff options
| author | Jacob Walls <jacobtylerwalls@gmail.com> | 2025-06-03 21:43:50 -0400 |
|---|---|---|
| committer | Sarah Boyce <42296566+sarahboyce@users.noreply.github.com> | 2025-08-21 16:47:41 +0200 |
| commit | a2ce4900a63f91f0cc685ac157762610c199c391 (patch) | |
| tree | f4f4b28e9196ac9b0f6462d52e5e0b9f802fd346 /django/db | |
| parent | fb0d463b1f88a38f3e7cd8d66ed6c69309f97901 (diff) | |
Fixed #36430 -- Removed artificially low limit on single field bulk operations on SQLite.
Diffstat (limited to 'django/db')
| -rw-r--r-- | django/db/backends/sqlite3/operations.py | 7 |
1 files changed, 1 insertions, 6 deletions
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) |
