| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Ecto is changing interpolated join queries (join: x in ^query) to carry their "on" expression as a BooleanExpr instead of a QueryExpr, since folded wheres may hold subqueries (elixir-ecto/ecto#4765). Relax the join.on pattern matches to the map shape so both structs are accepted. This matters beyond the crash in join/2: the using_join comprehensions filtered joins by on: %QueryExpr{}, so a BooleanExpr "on" would have been silently dropped from the WHERE clause of update_all/delete_all. Add coverage for interpolated join queries in update_all/delete_all, which previously had none. The relaxed patterns remain compatible with current Ecto releases. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
Superseded by #748, which now contains these changes — see josevalim's request there to merge the two. |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Companion to elixir-ecto/ecto#4765 (fix for elixir-ecto/ecto#4763).
That PR makes interpolated join queries (join: x in ^query) carry their on expression as a BooleanExpr instead of a QueryExpr, since wheres folded into the on may hold subqueries and BooleanExpr already owns them. Per the review discussion, the BooleanExpr is kept in the normalized query rather than converted back, so adapters must accept it.
This relaxes the %JoinExpr{on: %QueryExpr{expr: expr}} pattern matches in the postgres, myxql, and tds connections to the map shape %JoinExpr{on: %{expr: expr}}, accepting both structs. The relaxed patterns are compatible in both directions: this branch passes against ecto 3.14 from hex as well as against the ecto PR branch (ECTO_PATH), so it can ship independently of the ecto release.
Two failure modes without this change (verified by running this suite against the ecto PR branch):
Tests asserting the new subquery-in-join-on SQL itself (e.g. ON p1."id" IN (SELECT ...)) are intentionally left out for now, as they require the unreleased ecto — they can be added once the ecto side ships.
🤖 Generated with Claude Code