Repository navigation
fix: raise on unsupported query expressions - #137
Open
l-vincent-l wants to merge 1 commit into
Open
l-vincent-l wants to merge 1 commit into
l-vincent-l wants to merge 1 commit into
Conversation
The catch-all clause of expr/3 rendered any expression it could not
translate as a bare `?`. The next bound parameter was then used in its
place, silently changing the query instead of failing.
It now raises Ecto.QueryError ("unsupported expression ..."), as
ecto_sqlite3 does.
Contributor
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 57 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The catch-all clause of
expr/3renders any expression the adapter cannot translate as a bare?. The next bound parameter is then used in its place, silently changing the query instead of failing. Several past fixes (:identifierin #95, tagged/typed expressions in #67,exists/parent_as) were all instances of this.Change
The catch-all now raises
Ecto.QueryError("unsupported expression ..."), asecto_sqlite3does, so a missing translation fails loudly.This changes behaviour: a query that used an untranslated expression now raises instead of running with a wrong result.
Tests
Added to
test/in_expression_comprehensive_test.exs: an unsupported expression (ilike) raisesEcto.QueryError. No existing test relied on the placeholder.mix test --exclude turso_remote: all passing. No Rust changes.