Commit 38880b3
Capture filegroup and filestream names before calling parseIdentifier (#60)
* Fix inline index ON/FILESTREAM_ON clause parsing
Capture filegroup and filestream names before calling parseIdentifier
to ensure correct evaluation order in struct initialization.
Enables Baselines120_CreateTableTests120 test.
* Add CREATE EXTERNAL RESOURCE POOL statement support
- Add CreateExternalResourcePoolStatement AST type
- Add parsing for CREATE EXTERNAL RESOURCE POOL with parameters
- Support MAX_CPU_PERCENT, MAX_MEMORY_PERCENT, MAX_PROCESSES, AFFINITY
- Support AFFINITY CPU/NUMANODE with AUTO or range lists
- Add JSON marshaling for the new statement type
Enables CreateExternalResourcePoolStatementTests130 tests.
* Add TRIM function LEADING/TRAILING/BOTH option support
- Add TrimOptions field to FunctionCall AST type
- Parse LEADING, TRAILING, BOTH keywords before TRIM characters
- Add JSON marshaling for TrimOptions
Enables TrimFunctionTests160 tests.
* Add comprehensive RESTORE statement support
- Add TAPE device type support in FROM clause
- Add FILELISTONLY, VERIFYONLY, LABELONLY, REWINDONLY, HEADERONLY kinds
- Add MOVE restore option parsing (MOVE 'file' TO 'path')
- Add FILE, MEDIANAME, MEDIAPASSWORD, PASSWORD, STOPAT options
- Add ENABLE_BROKER, ERROR_BROKER_CONVERSATIONS, NEW_BROKER options
- Add KEEP_REPLICATION, RESTRICTED_USER options
- Fix STATS option to handle optional value (STATS or STATS = n)
- Update MoveRestoreOption to use ScalarExpression types
Enables RestoreStatementTests tests.
* Add standalone HASH support for inline index definitions
Handle HASH keyword without preceding NONCLUSTERED in table-level inline
index definitions. When HASH appears directly after UNIQUE, it is now
correctly interpreted as NonClusteredHash index type.
* Add OpenRowset Cosmos and TableReference support
Add parsing for OPENROWSET with named parameters (PROVIDER, CONNECTION,
OBJECT, CREDENTIAL) for Cosmos DB integration, and traditional OPENROWSET
syntax with positional arguments ('provider', 'connstr', tablename).
New AST types: OpenRowsetCosmos, OpenRowsetTableReference,
LiteralOpenRowsetCosmosOption, OpenRowsetColumnDefinition
* Add AS keyword support for function parameter declarations
Handle optional AS keyword in function parameter syntax like
@param AS datatype. This applies to CREATE FUNCTION, ALTER FUNCTION,
and CREATE OR ALTER FUNCTION statements.
* Add WITH clause column schema support for BULK OPENROWSET
Add WithColumns field to BulkOpenRowset for schema specification in
OPENROWSET BULK statements. Supports COLLATE clause and column ordinal
or JSON path specifications.
* Fix table hint and alias parsing order in FROM clause
Support both T-SQL table hint syntaxes:
1. Old-style: table_name (nolock) AS alias - hints before alias
2. New-style: table_name AS alias WITH (hints) - alias before hints
The parser now correctly handles both patterns by checking for old-style
hints first (parentheses without WITH), then parsing alias, then checking
for new-style hints (WITH keyword followed by parentheses).
* Add CREATE/ALTER/DROP LOGIN statement support
Add parsing for:
- CREATE LOGIN with PASSWORD, WINDOWS, CERTIFICATE, ASYMMETRIC KEY sources
- ALTER LOGIN ENABLE/DISABLE statements
- ALTER LOGIN WITH options (PASSWORD, NO CREDENTIAL, etc.)
- DROP LOGIN statement
Add new AST types:
- PasswordCreateLoginSource, WindowsCreateLoginSource
- CertificateCreateLoginSource, AsymmetricKeyCreateLoginSource
- AlterLoginEnableDisableStatement, AlterLoginOptionsStatement
- DropLoginStatement, OnOffPrincipalOption, PrincipalOptionSimple
Update PasswordAlterPrincipalOption to support both String and Binary passwords.
* Fix LoginStatementTests - handle national strings and IsIfExists
- Add IsIfExists field to DropLoginStatement
- Fix national string handling: strip N prefix and quotes from value
- Enable LoginStatementTests and Baselines90_LoginStatementTests
* Add support for service broker and other DROP statements
- Added DROP PARTITION FUNCTION/SCHEME, DROP APPLICATION ROLE,
DROP CERTIFICATE, DROP MASTER KEY, DROP XML SCHEMA COLLECTION,
DROP CONTRACT, DROP ENDPOINT, DROP MESSAGE TYPE, DROP QUEUE,
DROP REMOTE SERVICE BINDING, DROP ROUTE, DROP SERVICE,
DROP EVENT NOTIFICATION statements
- Added WITH NO DEPENDENTS option for DROP ASSEMBLY
- Added MAXDOP option for DROP INDEX
- Added DropBehavior (Cascade/Restrict) for DROP SCHEMA
- Added marshaling for DropFullTextCatalogStatement and
DropFulltextIndexStatement
- Enabled Baselines90_DropStatementsTests2 and DropStatementsTests2 tests
* Add CHANGETABLE, VALUES, and GlobalFunction table references
- Add CHANGETABLE(CHANGES) and CHANGETABLE(VERSION) parsing
- Add InlineDerivedTable for VALUES clause in FROM
- Add GlobalFunctionTableReference for STRING_SPLIT and GENERATE_SERIES
- Add Alias and Columns support for table function references
Enables: Baselines150_FromClauseTests150, FromClauseTests150,
Baselines160_BuiltInFunctionTests160, BuiltInFunctionTests160
* Add DATABASE AUDIT SPECIFICATION action and group support
- Add AuditActionSpecification and DatabaseAuditAction types
- Add DropDatabaseAuditSpecificationStatement
- Update parseAuditSpecificationPart to handle action specs
- Add batch group mappings (BatchCompletedGroup, BatchStartedGroup)
Enables: DatabaseAuditSpecificationStatementTests (all 4 variants)
* Add DATA_COMPRESSION option for columnstore indexes
- Add DATA_COMPRESSION parsing to columnstore index WITH clause
- Add DataCompressionOption case to columnStoreIndexOptionToJSON
Enables: CreateIndexStatementTests120 (both variants)
* Add XML_COMPRESSION table option support (partial progress)
- Add XmlCompressionOption and TableXmlCompressionOption types
- Add XML_COMPRESSION parsing in CREATE TABLE WITH clause
- Add partition ranges support for XML compression
Part of work towards CreateTableTests160
* Add TABLE DISTRIBUTION, CLUSTERED INDEX, and HEAP options for CREATE TABLE
- Add TableDistributionOption and TableHashDistributionPolicy AST types
- Add TableIndexOption, TableClusteredIndexType, and TableNonClusteredIndexType AST types
- Parse DISTRIBUTION = HASH(col1, col2, ...) in CREATE TABLE WITH clause
- Parse CLUSTERED INDEX(col), CLUSTERED COLUMNSTORE INDEX, and HEAP options
- Add JSON marshaling for all new table option types
- Enables Baselines160_CreateTableTests160 and CreateTableTests160 tests
* Add WINDOW clause and improve OVER clause support
- Add WindowClause and WindowDefinition AST types for SELECT WINDOW clause
- Add WindowFrameClause and WindowDelimiter AST types for ROWS/RANGE frames
- Add WindowName field to OverClause for window name references (OVER Win1)
- Create parseOverClause helper function and refactor all OVER parsing
- Add parseWindowClause for WINDOW Win1 AS (...) syntax
- Add parseWindowFrameClause for ROWS/RANGE BETWEEN ... AND ...
- Add JSON marshaling for all new window-related types
- Add WINDOW to reserved keyword lists for alias detection
- Enables Baselines160_WindowClauseTests160, WindowClauseTests160,
Baselines110_OverClauseTests110, and OverClauseTests110 tests
* Add BACKUP statement FILE/FILEGROUP list parsing and option kinds
- Support parenthesized list for FILE = ('f1', 'f2') and FILEGROUP = ('fg1', 'fg2')
- Add all BACKUP option kind mappings (BlockSize, BufferCount, Description, etc.)
- Enables BaselinesCommon_BackupStatementTests and BackupStatementTests tests
* Add ONLINE WAIT_AT_LOW_PRIORITY and XML_COMPRESSION support for CREATE INDEX
- Add OnlineIndexLowPriorityLockWaitOption AST type with LowPriorityLockWaitOption field
- Parse ONLINE = ON (WAIT_AT_LOW_PRIORITY (MAX_DURATION = N MINUTES, ABORT_AFTER_WAIT = SELF))
- Add XmlCompressionOption indexOption() method for index options
- Parse XML_COMPRESSION = ON/OFF [ON PARTITIONS(range)] in CREATE INDEX
- Add JSON marshaling for OnlineIndexOption with LowPriorityLockWaitOption
- Add JSON marshaling for XmlCompressionOption in index context
Enables Baselines160_CreateIndexStatementTests160 and CreateIndexStatementTests160.
* Add DataModificationTableReference and PIVOT/UNPIVOT support
- Add DataModificationTableReference AST for DML statements as table sources
- Add DataModificationSpecification interface implemented by Insert/Update/Delete/MergeSpecification
- Add parsing for INSERT/UPDATE/DELETE/MERGE in FROM clause subqueries
- Add parseInsertSpecification, parseUpdateSpecification, parseDeleteSpecification, parseMergeSpecification
- Add PivotedTableReference and UnpivotedTableReference AST types
- Add PIVOT and UNPIVOT parsing in parseTableReference
- Fix PIVOT/UNPIVOT being consumed as table aliases
- Add JSON marshaling for new table reference types
This is partial work toward Baselines100_FromClauseTests100 which still requires
FORCESEEK hints with index/columns and TABLE HINT optimizer hints.
* Add ForceSeekTableHint and FORCESCAN support for table hints
- Add ForceSeekTableHint AST type for FORCESEEK with optional index and column parameters
- Add FORCESEEK parsing with index name/number and column list support
- Add FORCESCAN to table hint kind mapping
- Add JSON marshaling for ForceSeekTableHint
- Enable Baselines100_FromClauseTests100 test
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent 6872611 commit 38880b3
File tree
70 files changed
+4814
-394
lines changed- ast
- parser
- testdata
- BackupStatementTests
- Baselines100_DatabaseAuditSpecificationStatementTests
- Baselines100_FromClauseTests100
- Baselines110_OverClauseTests110
- Baselines120_CreateIndexStatementTests120
- Baselines120_CreateTableTests120
- Baselines130_CreateExternalResourcePoolStatementTests130
- Baselines150_DatabaseAuditSpecificationStatementTests150
- Baselines150_FromClauseTests150
- Baselines160_BuiltInFunctionTests160
- Baselines160_CreateIndexStatementTests160
- Baselines160_CreateTableTests160
- Baselines160_OpenRowsetBulkStatementTests160
- Baselines160_TrimFunctionTests160
- Baselines160_WindowClauseTests160
- Baselines90_DropStatementsTests2
- Baselines90_LoginStatementTests
- BaselinesCommon_BackupStatementTests
- BaselinesCommon_RestoreStatementTests
- BuiltInFunctionTests160
- CreateExternalResourcePoolStatementTests130
- CreateIndexStatementTests120
- CreateIndexStatementTests160
- CreateTableTests120
- CreateTableTests160
- DatabaseAuditSpecificationStatementTests150
- DatabaseAuditSpecificationStatementTests
- DropStatementsTests2
- FromClauseTests150
- FunctionStatementTests
- LoginStatementTests
- OpenRowsetBulkStatementTests160
- OverClauseTests110
- RestoreStatementTests
- TrimFunctionTests160
- UniqueInlineIndex130
- WindowClauseTests160
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
70 files changed
+4814
-394
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
35 | | - | |
36 | | - | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
37 | 38 | | |
38 | 39 | | |
39 | 40 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
66 | 66 | | |
67 | 67 | | |
68 | 68 | | |
69 | | - | |
70 | | - | |
71 | | - | |
72 | | - | |
73 | | - | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
74 | 75 | | |
75 | 76 | | |
76 | 77 | | |
| |||
| 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 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
34 | 34 | | |
35 | 35 | | |
36 | 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 | + | |
37 | 64 | | |
38 | 65 | | |
39 | 66 | | |
| |||
46 | 73 | | |
47 | 74 | | |
48 | 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 | + | |
| 107 | + | |
| 108 | + | |
49 | 109 | | |
50 | 110 | | |
51 | 111 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
42 | 59 | | |
43 | 60 | | |
44 | 61 | | |
| |||
47 | 64 | | |
48 | 65 | | |
49 | 66 | | |
50 | | - | |
| 67 | + | |
51 | 68 | | |
52 | | - | |
| 69 | + | |
53 | 70 | | |
54 | 71 | | |
55 | 72 | | |
56 | 73 | | |
57 | 74 | | |
58 | 75 | | |
59 | 76 | | |
60 | | - | |
| 77 | + | |
| 78 | + | |
| 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 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 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 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
81 | 81 | | |
82 | 82 | | |
83 | 83 | | |
84 | | - | |
85 | | - | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
86 | 87 | | |
87 | 88 | | |
88 | 89 | | |
89 | 90 | | |
90 | 91 | | |
91 | 92 | | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
92 | 100 | | |
93 | 101 | | |
94 | 102 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
45 | | - | |
| 45 | + | |
| 46 | + | |
46 | 47 | | |
47 | 48 | | |
48 | 49 | | |
| |||
0 commit comments