1
0
mirror of https://github.com/django/django.git synced 2025-10-24 06:06:09 +00:00

Fixed #17788 -- Added batch_size argument to qs.bulk_create()

The qs.bulk_create() method did not work with large batches together
with SQLite3. This commit adds a way to split the bulk into smaller
batches. The default batch size is unlimited except for SQLite3 where
the batch size is limited to 999 SQL parameters per batch.

Thanks to everybody who participated in the discussions at Trac.
This commit is contained in:
Anssi Kääriäinen
2012-04-29 04:22:05 +03:00
parent fcad6c48f0
commit 29132ebdef
8 changed files with 110 additions and 38 deletions

View File

@@ -18,4 +18,8 @@ class Pizzeria(Restaurant):
pass
class State(models.Model):
two_letter_code = models.CharField(max_length=2, primary_key=True)
two_letter_code = models.CharField(max_length=2, primary_key=True)
class TwoFields(models.Model):
f1 = models.IntegerField(unique=True)
f2 = models.IntegerField(unique=True)