summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorAymeric Augustin <aymeric.augustin@m4x.org>2012-03-04 17:34:22 +0000
committerAymeric Augustin <aymeric.augustin@m4x.org>2012-03-04 17:34:22 +0000
commitcfd0cd1bc900b24e6206ca065520eef91d3ca3fa (patch)
treeb5dc3bc48fcbf22fd981191c01c2f51cddbd8084 /docs
parent20b021e5062de5b78d637e65a5df614682d26878 (diff)
Documented a limit of the SQLite backend, in relation with the bulk_create function. Refs #17788.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@17653 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'docs')
-rw-r--r--docs/ref/models/querysets.txt15
1 files changed, 15 insertions, 0 deletions
diff --git a/docs/ref/models/querysets.txt b/docs/ref/models/querysets.txt
index 13504f41cf..2b24fdd05c 100644
--- a/docs/ref/models/querysets.txt
+++ b/docs/ref/models/querysets.txt
@@ -1371,6 +1371,21 @@ This has a number of caveats though:
* If the model's primary key is an :class:`~django.db.models.AutoField` it
does not retrieve and set the primary key attribute, as ``save()`` does.
+.. admonition:: Limits of SQLite
+
+ SQLite sets a limit on the number of parameters per SQL statement. The
+ maximum is defined by the SQLITE_MAX_VARIABLE_NUMBER_ compilation option,
+ which defaults to 999. For instance, if your model has 8 fields (including
+ the primary key), you cannot create more than 999 // 8 = 124 instances at
+ a time. If you exceed this limit, you will get an exception::
+
+ django.db.utils.DatabaseError: too many SQL variables
+
+ If your application's performance requirements exceed SQLite's limits, you
+ should switch to another database engine, such as PostgreSQL.
+
+.. _SQLITE_MAX_VARIABLE_NUMBER: http://sqlite.org/limits.html#max_variable_number
+
count
~~~~~