Expand description
Compile GQL AST to parameterized SQL.
Two compilation paths:
- Fixed-length patterns (all edges *1..1) → JOIN chain
- Variable-length patterns (any edge *N..M where M>1) → recursive CTE
Synthetic edge paths (ADR-041):
- Relations prefixed
observed_as_*join againstevent_observations, notgraph_edges.
Security invariants (MAJ-1/MAJ-2/MAJ-3 from critic review):
- Namespace injection: WHERE clause always comes from CompileOptions.scopes, never the query.
- Edge property whitelist: only
relationandweightare queryable edge columns. - Depth cap: recursive CTE depth capped at MAX_DEPTH; exceeding it errors at validation.