INSERT ON CONFLICT clause support for HQL/Criteria #5897
Closed
beikov
started this conversation in
Design Proposals
Replies: 1 comment
-
This is probably a good path |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Support a
ON CONFLICT
clause similar to PostgreSQL in HQL/Criteria to allow implementing UPSERT semantics.The idea of the
ON CONFLICT
clause is to allow controlling what should happen when a constraint violation occurs, with the optionsDO NOTHING
andDO UPDATE
.Most DBs support this natively. For the ones that don't, we can catch the exception, look at the name of the violated constraint, match it and then execute the matching conflict action through a dedicated statement, but emulation could be done as part of a dedicated issue as well.
Beta Was this translation helpful? Give feedback.
All reactions