#19527: Allow QuerySet.bulk_create() to set the primary key of its objects
-------------------------------------+-------------------------------------
     Reporter:  Tuttle               |                    Owner:  nobody
         Type:  New feature          |                   Status:  new
    Component:  Database layer       |                  Version:  master
  (models, ORM)                      |
     Severity:  Normal               |               Resolution:
     Keywords:  oracle               |             Triage Stage:  Accepted
  QuerySet.bulk_create               |
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------

Comment (by akaariai):

 We should also consider if we want an implementation for MySQL and SQLite.

 On SQLite there is no concurrency when inserting to given table, so we can
 guess the inserted pk values from the last pk value in the table after the
 insert. On MySQL we might need to pre-allocate the ids.

 A safe-but-slow implementation is to resort to one item at time insert if
 primary keys are requested.

 There is a lot of work to having a bulk_create with primary keys for all
 backends, but this would allow usage of bulk_create in cases where we
 can't do that now.

--
Ticket URL: <https://code.djangoproject.com/ticket/19527#comment:34>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/064.998095a036f848c531cc271820c627e7%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to