Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP - OnConflict support for Insert mutations #503

Draft
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

olirice
Copy link
Contributor

@olirice olirice commented Mar 29, 2024

What kind of change does this PR introduce?

Adds an "onConflict" argument to insert mutations so they support upsert semantics

  • add <Table>Field type for which columns need to update
  • add <Table>OnConflictConstraint for which constraint should be used for upsert
  • make sure the enum values in <Table>OnConflictConstraint handle camel case and special characters
  • update builder restrict_allowed_arguments to dynamically allow an onConflict clause where it exists
  • add upsert support to the transpiler
  • test happy path
  • test no valid constraint exists
  • test passing an onConflict object when it isn't supported by the table
  • test weird constraint name
  • test pkey is serial/generated
  • test pkey is user definable

@olirice olirice mentioned this pull request Mar 29, 2024
@paulofaria
Copy link

I'm really excited about this! @olirice would love to know an ETA for upsert support. Don't feel pressured to answer if for some reason you can't provide an estimation. I know how maintaining OSS is. Keep up the good work, much appreciated! 🙂

@olirice
Copy link
Contributor Author

olirice commented May 9, 2024

I'm hoping to get it knocked out in the next few weeks. Its not too tough of a feature, just need to find some time to go heads down on it

I'm looking forward to using it too!

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.

None yet

2 participants