Using update to swap exclusive constraint values #8203
Unanswered
freiondrej
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello,
I have two objects with a rank property which is exclusive, let's say object A has rank 1 and object B has rank 2. I want to swap them - the object A will have rank 2 and object B will have rank 1.
In a previous, good old mysql DB, I used to address this by using some intermediate state to avoid exclusivity constraint violation - set object A to have rank 9999, object B to have rank 1 and then A to have 2. But since EdgeDB has been super impressive so far, I'm wondering if there's some idiomatic solution to this use case?
Thank you! 🙏 🙌
Beta Was this translation helpful? Give feedback.
All reactions