django-bulk-update-or-create
django-bulk-update-or-create copied to clipboard
Add option to use bulk_create for creating non-multi-table models
Add option to use bulk_create for creates: assert model is not multi-table, if enabled
Hi, as listed in one of the Todos, do you have a timeline for adding this option?
Your library otherwise provides so much convenience for bulk-upserting, but when it comes to simple models, using bulk creates would be so much faster than individual creates!
Hi, I’m not actively using this package at the moment so developing new features is on hold. I’m happy to take PRs though! I imagine something such as:
- “use_bulk_create” keyword argument that defaults to “auto”
- If “auto”, detect if model can use bulk create or not (multi table, maybe other conditions?)
- If it can, use it. If it cannot, do single creates and log warning (that can be disabled by explcitly setting the option to False) - this makes it clear to caller about future performance hits
- If True and bulk cannot be used, throw error