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

Wrapping update queries with joins in a subquery #998

Merged
merged 1 commit into from
Feb 10, 2024
Merged

Conversation

jwoertink
Copy link
Member

Fixes #827

This changes the syntax of the UPDATE sql so when you have a join, it moves the whole WHERE clause to a subquery.

Previously, if you tried to bulk update with a join, it would throw a postgres syntax error

UPDATE ... SET x = 1 INNER JOIN.....

Now this moves it to a subquery with

UPDATE ... SET x = 1 WHERE EXISTS (.... INNER JOIN ....);

@jwoertink jwoertink merged commit f1bfffc into main Feb 10, 2024
9 checks passed
@jwoertink jwoertink deleted the issues/827 branch February 10, 2024 22:07
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.

Can't bulk update from a query object with a join
1 participant