Commit 075600e
committed
feat(contract-psl): arrow-path through: column-based M:N recognition
Recognise the arrow-path many-to-many form
`through: "localKey -> Junction.nearCol -> Junction.farCol -> Target.targetKey"`
on terminal models over a junction that carries scalar columns + @@id but no
relation fields. The relation-field-based junction recognition cannot fire when
the junction declares no relation fields, so the resolver builds the `through`
descriptor straight from the path-named columns.
Value form: a quoted string (no grammar change). The parser already produces a
StringLiteralExpr; the resolver detects the `->` separator, strips quotes, and
splits the four segments. An unquoted arrow grammar would require a new
tokenizer token plus an expression node, AST class, union/cast extension,
printSyntax rendering, and formatter spacing rules — out of scope for this
escape-hatch slice.
Each end carries its own mirror-imaged path; both ends lower to N:M + through.
Diagnostics: malformed path (not four segments / bad arrows), a named column
absent on its model, the two junction columns on different models, and a
junction that is not a declared model.
Signed-off-by: Alexey Orlenko's AI Agent <robot@aqrln.net>1 parent f8559d9 commit 075600e
4 files changed
Lines changed: 739 additions & 12 deletions
File tree
- packages
- 2-sql/2-authoring/contract-psl
- src
- test
Lines changed: 6 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
33 | 39 | | |
34 | 40 | | |
35 | 41 | | |
| |||
Lines changed: 12 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
100 | 100 | | |
101 | 101 | | |
102 | 102 | | |
| 103 | + | |
103 | 104 | | |
104 | 105 | | |
105 | 106 | | |
| |||
568 | 569 | | |
569 | 570 | | |
570 | 571 | | |
| 572 | + | |
571 | 573 | | |
572 | 574 | | |
573 | 575 | | |
| |||
600 | 602 | | |
601 | 603 | | |
602 | 604 | | |
| 605 | + | |
603 | 606 | | |
604 | 607 | | |
605 | 608 | | |
| |||
612 | 615 | | |
613 | 616 | | |
614 | 617 | | |
| 618 | + | |
615 | 619 | | |
616 | 620 | | |
617 | 621 | | |
| |||
2158 | 2162 | | |
2159 | 2163 | | |
2160 | 2164 | | |
| 2165 | + | |
| 2166 | + | |
| 2167 | + | |
2161 | 2168 | | |
2162 | 2169 | | |
2163 | 2170 | | |
2164 | 2171 | | |
2165 | 2172 | | |
2166 | 2173 | | |
2167 | 2174 | | |
| 2175 | + | |
| 2176 | + | |
| 2177 | + | |
| 2178 | + | |
2168 | 2179 | | |
2169 | 2180 | | |
2170 | 2181 | | |
2171 | 2182 | | |
2172 | 2183 | | |
2173 | 2184 | | |
| 2185 | + | |
2174 | 2186 | | |
2175 | 2187 | | |
2176 | 2188 | | |
| |||
0 commit comments