Summary
Add Quantum-level support in the SleekDB adapter for filtering by related model fields (join paths) while keeping the existing DbalInterface API unchanged.
Problem
With the current SleekDB execution model, root where criteria are evaluated before join data is attached. This means criteria like filtering users by related fields (e.g. profiles.firstname, nested paths like user_meetings.tickets.type) cannot be expressed with SQL-like semantics today.
Goal
Implement a contract-preserving enhancement in Quantum SleekDB adapter to route related-path criteria to appropriate join subqueries and prune unmatched parents.
Constraints
- Do not change public method signatures in
DbalInterface.
- Preserve current behavior for root-only criteria and existing joins.
- Keep backward compatibility with existing tests.
Proposed Phase-1 Semantics
- Support
AND across root and related-scope criteria.
- Keep existing grouped criteria behavior in same scope.
- Defer/reject ambiguous cross-scope
OR semantics for now.
Acceptance Criteria
- Root criteria continue to behave exactly as before.
- Criteria with related paths are applied to join subqueries at correct depth.
- Parent records are filtered out when constrained related branch has no match.
- Existing SleekDB adapter tests remain green.
- New tests cover:
- single related path filter
- deep related path filter
- root + related AND combination
- invalid relation path handling
- unsupported cross-scope OR behavior (explicit failure or documented no-op)
Notes
This is a Quantum adapter enhancement on top of SleekDB internals and does not require upstream SleekDB changes.
Summary
Add Quantum-level support in the SleekDB adapter for filtering by related model fields (join paths) while keeping the existing
DbalInterfaceAPI unchanged.Problem
With the current SleekDB execution model, root
wherecriteria are evaluated beforejoindata is attached. This means criteria like filtering users by related fields (e.g.profiles.firstname, nested paths likeuser_meetings.tickets.type) cannot be expressed with SQL-like semantics today.Goal
Implement a contract-preserving enhancement in Quantum SleekDB adapter to route related-path criteria to appropriate join subqueries and prune unmatched parents.
Constraints
DbalInterface.Proposed Phase-1 Semantics
ANDacross root and related-scope criteria.ORsemantics for now.Acceptance Criteria
Notes
This is a Quantum adapter enhancement on top of SleekDB internals and does not require upstream SleekDB changes.