-
Notifications
You must be signed in to change notification settings - Fork 324
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
Implement remaining Update_Action
s for update_database_table
.
#7035
Conversation
9c2a4e4
to
e130f02
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good - just one thing to consider.
They key columns must be present under the same name in both tables. | ||
|
||
This will usually be a query of the form | ||
`DELETE FROM target WHERE (key_columns...) NOT IN (SELECT key_columns... FROM source)`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if a DELETE/JOIN would work better.
Add a constant marker to the source, and then something like:
DELETE target
FROM target
LEFT JOIN source ON ...
WHERE source.marker is NULL
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In SQLite the DELETE
syntax only allows for a WHERE
clause, no joins are available.
In Postgres, I guess we may try to play with MERGE
but that is for a later ticket, I think - so to be revisited in #7036
Pull Request Description
Closes #6498
Important Notes
Checklist
Please ensure that the following checklist has been satisfied before submitting the PR:
Scala,
Java,
and
Rust
style guides. In case you are using a language not listed above, follow the Rust style guide.
./run ide build
.