You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The typed query API can express fixed-hop relation chains, but not a
path with an explicit minimum and maximum depth. Selecting every
entity reachable through a recursive relation (e.g. all descendants
below one root through Composition(parent, child)) within a
caller-declared depth bound currently forces consumers into
client-side fallbacks: one request per hop, client-side joins, or
looping until no new nodes appear.
Proposed change
Add a bounded-path expression to the typed query API: bind a start
variable, an end variable, a relation type, ordered endpoint roles, min_depth, and a finite max_depth, without degrading the inferred Query[T] result type.
Acceptance criteria
Path identity, cycle handling, zero-length behavior,
duplicate-path versus selected-row distinctness, subtype
matching, and stable ordering are specified and covered by
tests.
Invalid bounds fail at query construction, before any
database I/O.
A test fixture schema with nested membership (depth >= 2,
shared subtrees, and at least one cycle) verifies the distinct
selected result set at each depth bound.
The Python bindings infer the exact typed result without Any,
casts, or ignore directives.
Summary
The typed query API can express fixed-hop relation chains, but not a
path with an explicit minimum and maximum depth. Selecting every
entity reachable through a recursive relation (e.g. all descendants
below one root through
Composition(parent, child)) within acaller-declared depth bound currently forces consumers into
client-side fallbacks: one request per hop, client-side joins, or
looping until no new nodes appear.
Proposed change
Add a bounded-path expression to the typed query API: bind a start
variable, an end variable, a relation type, ordered endpoint roles,
min_depth, and a finitemax_depth, without degrading the inferredQuery[T]result type.Acceptance criteria
duplicate-path versus selected-row distinctness, subtype
matching, and stable ordering are specified and covered by
tests.
database I/O.
shared subtrees, and at least one cycle) verifies the distinct
selected result set at each depth bound.
Any,casts, or ignore directives.
Related