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

fix(bug): allow "complex" filter with update statement #119

Merged
merged 2 commits into from
May 14, 2024

Conversation

bunnylushington
Copy link
Contributor

I ran into an issue where the following query failed:

db(:table)
|> filter(:col, in: [1, 2, 3])
|> update(other_col: "new value")

It seems like Moebius.Query.update was doing some re-arranging of parameters and placeholders but did not take into account the in (or other compound constructs). I removed that code and tweaked the remaining code to appropriately start the parameter numbers at the (seemingly) correct value.

The existing tests pass with some re-work. To ensure that my test assumptions were correct, I also added a couple of assertions to ensure the parameter list is in the correct order. While my changes do not adversely affect my code, I'm more than happy to consider a different approach if this is not sufficient.

Thanks for providing the library; it's proving extremely useful.

@robconery robconery requested a review from cpursley May 13, 2024 20:44
@cpursley
Copy link
Collaborator

Thank you @bunnylushington! Can you review the failing tests around code formatting?

@bunnylushington
Copy link
Contributor Author

No problem at all. Sorry I missed that before creating the PR.

@cpursley cpursley merged commit 3bfed53 into robconery:master May 14, 2024
1 check passed
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.

2 participants