#28668: Add support for ON CONFLICT to bulk_create
-------------------------------------+-------------------------------------
Reporter: Tom | Owner: nobody
Type: New | Status: new
feature |
Component: Database | Version: master
layer (models, ORM) |
Severity: Normal | Keywords:
Triage Stage: | Has patch: 0
Unreviewed |
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-------------------------------------+-------------------------------------
When using bulk_create it would be nice to support `ON CONFLICT DO
NOTHING`, which allows existing rows to be included in the `bulk_create`
call, e.g:
{{{#!python
Comment.objects.create(name='test', text='test')
Comment.objects.bulk_create(Comment(name='test', text='test'),
on_conflict=IGNORE) # Does not throw an exception
}}}
All the databases we support have syntax for this, as well as
updating/replacing fields.
--
Ticket URL: <https://code.djangoproject.com/ticket/28668>
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/046.adebe81a35602b7d6bca0b0b9e447097%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.