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

Upsert deleteUnmatched Should allow expresssion #285

Open
jclausen opened this issue Jun 30, 2024 · 0 comments
Open

Upsert deleteUnmatched Should allow expresssion #285

jclausen opened this issue Jun 30, 2024 · 0 comments

Comments

@jclausen
Copy link
Contributor

jclausen commented Jun 30, 2024

The deleteUnmatched argument in the upsert function is currently too loose, as the result is a deletion of all rows in the database that don't match the source. Its current implementation is an atomic operation on the entire table.

It should be updated to allow an expression to restrict what gets deleted.

Example:

WHEN NOT MATCHED BY SOURCE AND qb_target.foo = 'bar' AND qb_target.active = 1 THEN DELETE

Suggest that the right hand side should allow an expression. Of note is the fact that qb_src cannot be referenced in the WHEN NOT MATCHED BY SOURCE clause.

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

No branches or pull requests

1 participant