-
-
Notifications
You must be signed in to change notification settings - Fork 494
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
Question: Combining multiple Statements #706
Comments
I can always just combine the individual statements like this:
But I am not sure if this is safe enough to do. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hello
I know it is possible to combine multiple
SELECT
statements, but I have a use case where I could use some sort of combineQuery
for delete + insert.In this specific use case, I need to delete all rows (1 + n) that match a certain ID, and then insert new rows again in one transaction.
There are alternatives like delete only what should not be there and insert only what is missing. But in a event-sourced system this can get out of hand quickly.
Right now we do this using
and then loop over what we have to insert and do
Which results in something like
But the system underneath which executes the individual statements cannot guarantee the order of queued individual statements.
So my idea is to queue one operation which contains the combined individual statements statements.
Is there any support or recommended way to do this?
The text was updated successfully, but these errors were encountered: