Skip to content

Bulk create update#288

Open
tombch wants to merge 5 commits into
developmentfrom
bulk-create-update
Open

Bulk create update#288
tombch wants to merge 5 commits into
developmentfrom
bulk-create-update

Conversation

@tombch

@tombch tombch commented Feb 5, 2026

Copy link
Copy Markdown
Collaborator
  • This PR attempts to optimise the create endpoint by delegating 'nested' records to a bulk create rather than being created individually.
  • It seems like an obvious thing to do, but I think before merging this PR it needs more investigation into potential ramifications of switching from creation via serializer to direct bulk creation.
  • Bulk updates could also be useful if correctly added, and django-simple-history has support for this - currently not a feature though.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request attempts to optimize the creation of nested objects by using bulk database operations instead of individual saves. The change modifies the _save method in SerializerNode to collect new nested instances and create them in bulk using bulk_create_with_history from the django-simple-history library.

Changes:

  • Import bulk_create_with_history from simple_history.utils
  • Modify nested object saving logic to distinguish between updates and creates
  • Use bulk_create_with_history for creating multiple new nested objects at once

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread onyx/data/serializers.py
Comment thread onyx/data/serializers.py
Comment thread onyx/data/serializers.py
Comment thread onyx/data/serializers.py
Comment thread onyx/data/serializers.py
@tombch tombch closed this Feb 6, 2026
@tombch tombch reopened this Feb 9, 2026
@tombch tombch added the wip This is a work in progress and likely needs work/reviewing label Feb 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

wip This is a work in progress and likely needs work/reviewing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants