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

BUG: ApplyChanges should only execute a single query for multiple changes to a single record. #2204

Open
rathboma opened this issue May 13, 2024 · 0 comments
Labels
accepted 👍 bug Something isn't working

Comments

@rathboma
Copy link
Collaborator

If you change 3 fields of a record, then apply (or copy to SQL), Beekeeper will generate 3 separate update queries. It should instead only generate a single query per record.

Bad

UPDATE mytable SET a = 'a' WHERE id = 1;
UPDATE mytable SET b = 'b' WHERE id = 1;
UPDATE mytable SET c = 'c' WHERE id = 1;

Good

UPDATE mytable SET a = 'a', b = 'b', c = 'c' WHERE id = 1

This might require some real refactoring of the change builder classes, not sure.

@rathboma rathboma added bug Something isn't working accepted 👍 labels May 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
accepted 👍 bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant