Skip to content

Update ScriptDom to 180.154.0 and sync upstream tests - #69

Merged
kyleconroy merged 2 commits into
mainfrom
claude/project-thread-4tipff
Dec 1, 2026
Merged

kyleconroy merged 2 commits into
mainfrom
claude/project-thread-4tipff

Conversation

@kyleconroy

@kyleconroy kyleconroy commented Dec 1, 2026 •

Copy link
Copy Markdown
Collaborator

Requested by Kyle · project thread

Summary

Bumps the SQL Server parser we test against from ScriptDom 170.128.0 / TSql160Parser to 180.154.0 / TSql180Parser (the newest on NuGet), and syncs the test corpus with microsoft/SqlScriptDOM@3ea69b6.

Tooling

  • TsqlAstParser now references ScriptDom 180.154.0 and uses TSql180Parser, or TSqlFabricDWParser for *FabricDW tests (mirroring upstream's test layout).
  • CI (.github/workflows/test.yml) now runs on every pull request, not only PRs targeting main, so stacked PRs get checks.
  • CLAUDE.md documents the new version and how tests map to upstream TestScripts/, Baselines*/ and PhaseOneTestScripts/.

Test corpus

  • 74 new tests from upstream (TestScripts + Baselines).
  • 22 updated query.sql files where upstream added cases (PhaseOne scripts intentionally keep the first invalid line stripped).
  • Regenerated every ast.json the official parser accepts (886 existing goldens). PhaseOne goldens are hand-written and the full parser rejects them, so they're unchanged.
  • 48 tests previously marked invalid_syntax (SQL 2025 / Fabric DW features that TSql160 couldn't parse) now have goldens.
  • Of the 122 newly generated tests, 29 already pass and are enabled; 93 are marked todo (46 distinct features: AI functions, external models, JSON functions/indexes, vector index/search, ORDER BY ALL, TOP ... WITH APPROXIMATE, Fabric DW CLONE/CLUSTER BY, etc.).

Parser changes to match ScriptDom 180 output

  • TSqlScript.TrailingGoCount (number of GO separators after the last batch). The test harness ignores it for legacy hand-written goldens that predate it.
  • OrderByClause.All / AllSortOrder.
  • TopRowFilter.WithApproximate, OffsetClause.WithApproximate.
  • VECTOR(n [, type]) now parses to VectorDataTypeReference; DECLARE now accepts any DataTypeReference.
  • First argument of DATEADD/DATEDIFF/DATEDIFF_BIG/DATENAME/DATEPART/DATETRUNC/DATE_BUCKET becomes an IdentifierLiteral (ScriptDom's NormalizeDatePartFunctionFirstParameter).
  • REGEXP_MATCHES / REGEXP_SPLIT_TO_TABLE in FROM produce GlobalFunctionTableReference.

Test plan

  • go test ./... passes
  • go test ./parser/... -check-todo enabled the 29 passing new tests

https://claude.ai/code/session_01LuRZ4JQ53XPMqUY3Yc1vdv


Generated by Claude Code

Bump Microsoft.SqlServer.TransactSql.ScriptDom from 170.128.0 to
180.154.0 and generate goldens with TSql180Parser (TSqlFabricDWParser
for *FabricDW tests) instead of TSql160Parser.

Sync test scripts from microsoft/SqlScriptDOM@3ea69b6: 74 new tests,
22 updated query.sql files. Regenerate every ast.json the official
parser accepts. 48 tests previously marked invalid_syntax now parse.

Parser/marshal changes to match ScriptDom 180 output:
- TSqlScript.TrailingGoCount
- OrderByClause.All / AllSortOrder
- TopRowFilter.WithApproximate, OffsetClause.WithApproximate
- VECTOR(n[, type]) -> VectorDataTypeReference (also in DECLARE)
- datepart argument of DATEADD/DATEDIFF/DATEPART/... -> IdentifierLiteral
- REGEXP_MATCHES / REGEXP_SPLIT_TO_TABLE -> GlobalFunctionTableReference

29 of the new tests pass and are enabled; the rest are marked todo.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LuRZ4JQ53XPMqUY3Yc1vdv
@kyleconroy kyleconroy self-assigned this Dec 1, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LuRZ4JQ53XPMqUY3Yc1vdv
@kyleconroy
kyleconroy added this pull request to stack #73 December 1, 2026 06:14
@kyleconroy
kyleconroy merged commit c6011fe into main Dec 1, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants