Commit 8347817
authored
feat(vnext): recognize bounded relation query sites (#186)
## Summary
- add a private parser-independent partial `SELECT` relation-site
recognizer
- authenticate full relation paths and statement-relative UTF-16
replacement ranges
- enforce dialect-owned identifier/path decoding and path depth under a
global safety ceiling
- recognize base `FROM`, qualified prefixes, aliases, joins, same-depth
commas, nested queries, and dialect-owned `NATURAL` joins
- authenticate the bounded `USING(identifier [, identifier ...])`
grammar before crossing a join constraint
- deliberately fail closed on `ON` until a parser-backed or separately
specified expression recognizer can prove its boundary
- preserve frame-local nested-query recognition after proven relation
transitions and valid `USING` clause exits
## Safety and performance
- active statement: 65,536 UTF-16 units
- lexemes: 16,384
- nesting: 128
- path: dialect limit under global 32
- decoded identifier segment: 256 UTF-16 units
- exact 10 KiB statement: about 0.56 ms mean
- 1,000 classified aliases: about 0.36 ms mean
- 1,000 authenticated `USING` columns: about 0.21 ms mean
- recognizer state remains bounded per query frame and per active
`USING` constraint
## Verification
- 1,537 tests passed plus 1 expected failure
- changed coverage: 96.84% statements, 95.76% branches, 100% functions,
96.83% lines
- repository coverage: 95.31% statements, 92.04% branches, 96.14%
functions, 95.30% lines
- source, test, loose-optional, and demo typechecks pass
- repository oxlint, test-integrity, and diff checks pass
- browser, package, worker-placement, demo, and benchmark gates pass
- three independent adversarial reviewers approved exact commit
`01cd8d29bf99a7c07f6a72ca746da328847c6dfb`
Part of #169.1 parent ef47c7f commit 8347817
5 files changed
Lines changed: 3496 additions & 5 deletions
File tree
- docs/adr
- src/vnext
- __tests__
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
97 | 97 | | |
98 | 98 | | |
99 | 99 | | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
100 | 107 | | |
101 | | - | |
| 108 | + | |
| 109 | + | |
102 | 110 | | |
103 | | - | |
104 | | - | |
105 | | - | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
106 | 114 | | |
107 | 115 | | |
108 | 116 | | |
| |||
518 | 526 | | |
519 | 527 | | |
520 | 528 | | |
521 | | - | |
| 529 | + | |
522 | 530 | | |
523 | 531 | | |
524 | 532 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
| 30 | + | |
30 | 31 | | |
31 | 32 | | |
32 | 33 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
0 commit comments