feat: nested join ON queries - #942
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. 🗂️ Base branches to auto review (2)
Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
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 |
Greptile SummaryThe PR adds nested JOIN ON conditions and ensures their predicates retain JOIN semantics while participating in normal query and index validation.
Confidence Score: 5/5The PR appears safe to merge once its declared upstream query-library dependency is available. No blocking failure remains; the previously reported index-validation bypass and vector double-count are addressed by the current traversal and focused regression tests. Important Files Changed
Reviews (6): Last reviewed commit: "fix: count nested join ON vectors once" | Re-trigger Greptile |
Collect join aliases from Query::getJoinAlias() so nested leftJoin('orders', 'ord', [Query::on(...), Query::equal(...)]) works. Qualify ON columns, validate Query::on triples, and compile extra ON filters onto the JOIN instead of WHERE.
0403d12 to
b1466d6
Compare
IndexedQueries walked nested and/or children but skipped getJoinOnQueries(), so a search or extra vector predicate on JOIN ON bypassed fulltext-index and single-vector checks.
|
@greptileai review |
getJoinOnQueries() returns list<Utopia\Query\Query>, not Database\Query. IndexedQueries now accepts the base type so PHPStan no longer rejects the recursive search and vector walks.
|
@greptileai review |
Replace the join-on branch alias with ^0.5 now that query-lib 0.5.0 is published.
Walk JOIN ON children exclusively so a single vector predicate in ON is not counted twice if join methods later report as nested.
|
@greptileai review Addressed the JOIN ON vector double-count: IndexedQueries walks nested join ON children exclusively, with a unit test that a single vector in JOIN ON is valid. |
Summary
dev-feat-join-on-queries as 0.4.99).Query::onplus filter queries).getJoinAlias()so nestedleftJoin('orders', 'ord', [...])unlocksord.*in select/filter/order.Query::oncolumns and dotted ON filters; extra ON predicates compile onto the JOIN (LEFT JOIN semantics).Stacked on
feat-query-lib. Do not merge until query#20 is in.Test plan