Skip to content

docs: Added documentation for new on conflict do nothing functionality for DB inserts#435

Merged
marcelomendoncasoares merged 2 commits intoserverpod:mainfrom
FXschwartz:db-on-conflict
Mar 3, 2026
Merged

docs: Added documentation for new on conflict do nothing functionality for DB inserts#435
marcelomendoncasoares merged 2 commits intoserverpod:mainfrom
FXschwartz:db-on-conflict

Conversation

@FXschwartz
Copy link
Contributor

Cover usage over PR - serverpod/serverpod#4729

@marcelomendoncasoares Docs submitted for the DB on conflict insert! Let me know what kind of changes you'd like made.

Copilot AI review requested due to automatic review settings March 3, 2026 14:43
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds documentation for the new “on conflict do nothing” behavior when performing DB inserts, explaining how to perform idempotent inserts that skip duplicates instead of failing.

Changes:

  • Documented ignoreConflicts: true usage on insert for skipping unique-constraint conflicts
  • Added a Dart example showing batch insert with conflicts ignored
  • Added a note tying the behavior to PostgreSQL ON CONFLICT DO NOTHING and linking to indexing docs

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

Copy link
Collaborator

@marcelomendoncasoares marcelomendoncasoares left a comment

Choose a reason for hiding this comment

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

LGTM! Thanks for the quick update to the docs, @FXschwartz! 🚀

@marcelomendoncasoares marcelomendoncasoares merged commit 76502d1 into serverpod:main Mar 3, 2026
4 checks passed
@marcelomendoncasoares
Copy link
Collaborator

@FXschwartz I just realized that we missed a warning in case the flag is used for inserting too many rows of models with non-persistent fields. Could you add such note on this section?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants