Skip to content

fix: raise on unsupported query expressions - #137

Open
l-vincent-l wants to merge 1 commit into
ocean:mainfrom
l-vincent-l:raise-on-unsupported-expressions
Open

l-vincent-l wants to merge 1 commit into
ocean:mainfrom
l-vincent-l:raise-on-unsupported-expressions

Conversation

@l-vincent-l

Copy link
Copy Markdown

Problem

The catch-all clause of expr/3 renders 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 (:identifier in #95, tagged/typed expressions in #67, exists/parent_as) were all instances of this.

Change

The catch-all now raises Ecto.QueryError ("unsupported expression ..."), as ecto_sqlite3 does, 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) raises Ecto.QueryError. No existing test relied on the placeholder. mix test --exclude turso_remote: all passing. No Rust changes.

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.
@coderabbitai

coderabbitai Bot commented Oct 22, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

You'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.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: f758b5f9-0381-4034-910c-7bdafd2c4b48
📥 Commits

Reviewing files that changed from the base of the PR and between dd83b45 and 3d64e58.

📒 Files selected for processing: 3
  • CHANGELOG.md
  • lib/ecto/adapters/libsql/connection.ex
  • test/in_expression_comprehensive_test.exs
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

This branch has not been deployed

No deployments
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.

1 participant