hasura / hasura/graphql-engine
Handle multiple constraint violations on upsert
- Dominant language
- TypeScript
- Stars
- 32.1k
- Forks
- 3k
- PR merge metrics
- PR metrics pending
Description
`graphql-engine: hasura/graphql-engine:v1.1.0.cli-migrations`
How can I go about handling multiple constraint violations?
Say I have two constraints, `[my_first_constraint, my_second_constraint]`
```
on_conflict: {
constraint: my_first_constraint,
update_columns: [updated_at]
}
```
Works for `my_first_constraint` violations, but then errors out when `my_second_constraint` conflicts during an upsert.
I know Postgres doesn't handle multiple constraints, but is there a way to do something like this;
```
on_conflict: {
constraint: null,
update_columns: [updated_at]
}
```
And specify that regardless of the violation, just update `updated_at`? I'm updating the column because I want the row to be returned.
How do I specify an update action regardless of constraint target?
Contributor guide
Assessment
This issue has not been assessed yet.