Commit e5b8c34
release: 2.2.0 — parameterized TOP / OFFSET / FETCH
CosmoSQLClient.CosmoKv 2.2.0 / CosmoSQLClient.CosmoKvHttp 2.2.0.
Implements task #35 from the v2.2 candidate list. The parser now admits
any scalar expression in paging slots, removing the integer-literal
restriction that blocked 8 stored procedures in CosmoMailServer's
Phase C migration plus the UPDATE TOP(n) claim-pending rewrites.
New surface:
SELECT TOP @n … -- bare-form: atom only
SELECT TOP (@A + @b) … -- paren-form: full expression
SELECT … OFFSET @offset ROWS FETCH NEXT @limit ROWS ONLY
UPDATE TOP(@Batch) … OUTPUT INSERTED.*
DELETE TOP(@n) … OUTPUT DELETED.*
Bare-form TOP keeps a tight grammar (ParseUnary only) to preserve the
`SELECT TOP 10 * FROM t` wildcard-vs-multiplication disambiguation.
Non-trivial paging expressions must be parenthesised (matches T-SQL
spec). OFFSET / FETCH and UPDATE/DELETE TOP(n) accept full expressions
since their syntactic position has no wildcard ambiguity.
Out of scope for v2.2 (deferred):
- Function-call DEFAULT in CREATE TABLE (task #34) — would require
AST stringification or polymorphic JSON serialization to round-trip
through the catalog. Phase B's workaround (drop DEFAULT, supply
timestamps in C# call sites) is already in place and arguably
cleaner. Revisit only if a new consumer needs it.
Tests: Phase9ParameterizedPagingTests adds 9 cases. Coverage includes
parameter-driven TOP/OFFSET/FETCH, arithmetic in TOP-parens,
UPDATE TOP(@Batch) for claim-pending, DELETE TOP(@n), negative-value
and string-value rejection, and the literal-TOP regression path.
Full suite stable: 240/240 across 3 consecutive runs.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 835d6ff commit e5b8c34
1 file changed
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
| 10 | + | |
11 | 11 | | |
12 | 12 | | |
0 commit comments