Skip to content

Conversation

@kyleconroy
Copy link
Collaborator

  • Handle MAXDOP and FAST as keyword tokens (not identifiers)
  • Support two-word hints: HASH GROUP, CONCAT UNION, LOOP JOIN, MERGE JOIN,
    MERGE UNION, HASH JOIN, HASH UNION, ORDER GROUP, FORCE ORDER
  • Add additional two-word hints: KEEP UNION, ROBUST PLAN, EXPAND VIEWS,
    KEEPFIXED PLAN, SHRINKDB PLAN, ALTERCOLUMN PLAN, BYPASS OPTIMIZER_QUEUE
  • Support literal hints with values (FAST n, MAXDOP n, USEPLAN n)
  • Add isSecondHintWordToken helper to properly detect keyword tokens
    (GROUP, JOIN, UNION, ORDER) as second words in two-word hints

- Handle MAXDOP and FAST as keyword tokens (not identifiers)
- Support two-word hints: HASH GROUP, CONCAT UNION, LOOP JOIN, MERGE JOIN,
  MERGE UNION, HASH JOIN, HASH UNION, ORDER GROUP, FORCE ORDER
- Add additional two-word hints: KEEP UNION, ROBUST PLAN, EXPAND VIEWS,
  KEEPFIXED PLAN, SHRINKDB PLAN, ALTERCOLUMN PLAN, BYPASS OPTIMIZER_QUEUE
- Support literal hints with values (FAST n, MAXDOP n, USEPLAN n)
- Add isSecondHintWordToken helper to properly detect keyword tokens
  (GROUP, JOIN, UNION, ORDER) as second words in two-word hints
- Create AddSignatureStatement and DropSignatureStatement AST types
- Parse ADD [COUNTER] SIGNATURE TO [element-kind::] element BY crypto-list
- Parse DROP [COUNTER] SIGNATURE FROM [element-kind::] element BY crypto-list
- Support element kinds: Object, Assembly, Database
- Support crypto mechanisms: Certificate, AsymmetricKey, Password
- Handle WITH PASSWORD = and WITH SIGNATURE = options
- Add TopRowFilter parsing for UPDATE TOP (n) [PERCENT] syntax
- Add OutputClause and OutputIntoClause parsing for UPDATE OUTPUT
- Add TopRowFilter, OutputClause, OutputIntoClause fields to UpdateSpecification
- Create FunctionCallSetClause AST type for mutator function calls
- Implement parseSetClause to detect and parse function call SET clauses
- Add JSON marshaling for FunctionCallSetClause and new UpdateSpecification fields
… strings

- Add OrderHint and MethodSpecifier fields to CreateFunctionStatement AST
- Add DeclareTableVariableBody field to TableValuedFunctionReturnType
- Add ExecuteAsFunctionOption type for EXECUTE AS in function options
- Parse RETURNS TABLE (column_definitions) for CLR functions
- Parse ORDER (columns ASC/DESC) clause for CLR table-valued functions
- Parse EXECUTE AS 'string_literal' in function WITH options
- Parse AS EXTERNAL NAME assembly.class.method for CLR functions
- Add orderBulkInsertOptionToJSON and executeAsFunctionOptionToJSON marshaling
- Update functionReturnTypeToJSON to handle TableValuedFunctionReturnType

Enables CreateFunctionStatementTests100 and Baselines100_CreateFunctionStatementTests100.
- Expand AlterAssemblyStatement AST with Parameters, Options, AddFiles, DropFiles, IsDropAll
- Add AddFileSpec, AssemblyOption, OnOffAssemblyOption, PermissionSetAssemblyOption types
- Parse FROM 'path' clauses for assembly source
- Parse DROP FILE ALL and DROP FILE 'filename' clauses
- Parse ADD FILE FROM 'path' with optional AS 'name' clauses
- Parse WITH options: PERMISSION_SET, VISIBILITY, UNCHECKED DATA
- Add assemblyOptionToJSON and addFileSpecToJSON marshaling functions

Enables Baselines90_AlterAssemblyStatementTests.
- Add MemoryOptimizedTableOption AST type
- Add Options field to CreateTypeTableStatement
- Parse WITH (MEMORY_OPTIMIZED = ON/OFF) in CREATE TYPE AS TABLE statements
- Add MemoryOptimizedTableOption marshaling to tableOptionToJSON

This enables partial support for table type tests.
Implement parsing for ALTER SEARCH PROPERTY LIST with ADD and DROP actions,
including WITH options (PROPERTY_SET_GUID, PROPERTY_INT_ID, PROPERTY_DESCRIPTION).
- Add Index field to ColumnDefinition for inline column indexes
- Parse NONCLUSTERED HASH index type
- Parse WITH (BUCKET_COUNT = n) index options
- Fix parseInlineIndexDefinition to use parseIdentifier (strips brackets properly)
- Fix parseTableConstraint PRIMARY KEY to parse columns instead of skipping them
- Fix indexTypeToJSON to only include IndexTypeKind when present
- Add SimpleRestoreOption, StopRestoreOption, and BackupRestoreFileInfo types
- Parse FILE = clause before FROM for file-specific restores
- Handle WITH clause without FROM clause for RESTORE LOG statements
- Parse STOPATMARK/STOPBEFOREMARK with AFTER clause
- Parse STANDBY as ScalarExpressionRestoreOption
- Parse common flags (KEEP_TEMPORAL_RETENTION, NOREWIND, etc) as SimpleRestoreOption
- Use PhysicalDevice for DISK/URL device types
- Strip quotes from string literals in device and file parsing
- Break out of parsing loop on unknown tokens instead of skipping
- Conditionally include IsDropAll only when relevant content exists
- Add BackupMasterKeyStatement AST type
- Implement parseBackupMasterKeyStatement function
- Add backupMasterKeyStatementToJSON marshaling
- Wire up in backup statement parsing switch
…echanisms

- Add KeySourceKeyOption and IdentityValueKeyOption AST types and JSON marshaling
- Add normalizeAlgorithmName function for correct algorithm casing (Des, RC2, etc.)
- Fix parseAlterSymmetricKeyStatement to only parse encryption mechanisms when
  ADD/DROP is present
- Fix alterSymmetricKeyStatementToJSON to conditionally include IsAdd field
- Enable SymmetricKeyStatementTests and Baselines90_SymmetricKeyStatementTests
- Add CreateDatabaseEncryptionKeyStatement, AlterDatabaseEncryptionKeyStatement,
  and DropDatabaseEncryptionKeyStatement AST types
- Implement parsing for CREATE/ALTER/DROP DATABASE ENCRYPTION KEY
- Support ALGORITHM option with proper normalization
- Support ENCRYPTION BY SERVER CERTIFICATE/ASYMMETRIC KEY clause
- Support REGENERATE option in ALTER
- Enable Baselines100_DatabaseEncryptionKeyStatementTests and
  DatabaseEncryptionKeyStatementTests
- Update parseAlterExternalLibraryStatement to track current file option
  and assign PLATFORM to it when parsing SET clause
- Enable Baselines150_AlterExternalLibrary150 and AlterExternalLibrary150
- Handle ADD/DROP ROWGUIDCOL and ADD/DROP NOT FOR REPLICATION options
- Parse COLLATE clause for column type changes
- Parse NULL/NOT NULL option for nullability changes
- Add Collation field to AlterTableAlterColumnStatement
- Update JSON marshaling with correct field ordering
- Enable AlterTableAlterColumnStatementTests and
  BaselinesCommon_AlterTableAlterColumnStatementTests
- Add IndexOptions and OnFileGroupOrPartitionScheme fields to UniqueConstraintDefinition
- Add parseConstraintIndexOptions function for parsing WITH (index_options)
- Update parseUniqueConstraint, parsePrimaryKeyConstraint and column-level
  constraint parsing to handle WITH and ON clauses
- Fix parseIdentifierOrValueExpression to use parseIdentifier for proper
  handling of square-bracket quoted identifiers
- Update uniqueConstraintToJSON marshaling to output new fields

Tests enabled:
- Baselines90_UniqueConstraintTests90
- Baselines90_UniqueConstraintTests
- UniqueConstraintTests90
- CreateSpatialIndexStatementTests
- Baselines100_CreateSpatialIndexStatementTests
- Add IgnoreRespectNulls field to FunctionCall AST type
- Parse RESPECT NULLS and IGNORE NULLS clauses after function
  parameters and before OVER clause
- Update JSON marshaling to output IgnoreRespectNulls

Tests enabled:
- Baselines160_IgnoreRespectNullsSyntaxTests160
- IgnoreRespectNullsSyntaxTests160
- Add AddSensitivityClassificationStatement and DropSensitivityClassificationStatement AST types
- Add SensitivityClassificationOption type for WITH clause options
- Add IdentifierLiteral type for RANK = HIGH style values
- Parse ADD SENSITIVITY CLASSIFICATION TO columns WITH options
- Parse DROP SENSITIVITY CLASSIFICATION FROM columns
- Add JSON marshaling for all new types

Tests enabled:
- DataClassificationTests150
- DataClassificationTests140
- DataClassificationTests130
- Baselines150_DataClassificationTests150
- Baselines140_DataClassificationTests140
- Baselines130_DataClassificationTests130
- Extend CreateIndexStatement with Unique, Clustered, Columns, IncludeColumns,
  IndexOptions, and OnFileGroupOrPartitionScheme fields
- Implement parseCreateIndexStatement with full column list parsing
- Add parseCreateIndexOptions for WITH clause index options
- Add indexOption() method to OnlineIndexOption for interface compatibility
- Update createIndexStatementToJSON marshaling with all new fields
- Update PhaseOne_CreateIndexStatementTest expected output for full parsing
Fix CREATE INDEX parsing to properly marshal ONLINE option by adding
OnlineIndexOption case to indexOptionToJSON function.
Change UserLoginOptionType values to match Microsoft ScriptDom format:
- "ForLogin"/"FromLogin" -> "Login"
- "FromCertificate" -> "Certificate"
- "FromAsymmetricKey" -> "AsymmetricKey"

This enables Baselines90_UserStatementTests, UserStatementTests, and
CreateIndexStatementTests90 tests.
- Add NULL principal type support to GRANT, DENY, REVOKE statements
- Add DENY and REVOKE token handling to parseCreateSchemaStatement
- Add WITH GRANT OPTION parsing to GRANT statements
- Add AsClause field to RevokeStatement for AS syntax
- Add OnlineIndexOption to indexOptionToJSON marshaling

All currently enabled tests pass. CreateSchemaStatementTests90 still needs
more work for complex nested schema element statements.
… parsing

- Add Columns field to Permission struct for column-level permissions
- Add TokenLParen handling in REVOKE permission parsing
- Add TokenAll to allowed permission identifier tokens
- Fix multi-part identifier parsing to handle double dots (e.g., a.b..d)
  by creating empty identifier for missing parts
- Enable CreateSchemaStatementTests90 test
- Add Owner, Parameters, and Options fields to CreateAssemblyStatement
- Parse AUTHORIZATION clause for Owner
- Parse FROM clause with expressions for Parameters
- Parse WITH PERMISSION_SET option for Options
- Enable Baselines90_CreateAssemblyStatementTests
- Detect function calls (identifier followed by non-hint parentheses) in
  parseSingleTableReference
- Parse function parameters using parseFunctionParameters
- Return SchemaObjectFunctionTableReference for TVFs like REGEXP_MATCHES
- Add parseNamedTableReferenceWithName helper for pre-parsed schema names
- Enable Baselines170_RegexpTVFTests170 test
- Add AUTO_DROP option handling in parseCreateStatisticsStatement
- Fix INCREMENTAL OptionState casing (On/Off instead of ON/OFF)
- Enable Baselines160_CreateStatisticsStatementTests160
- Enable CreateStatisticsStatementTests160
- Add PredictTableReference for PREDICT(MODEL=, DATA=, RUNTIME=) WITH clause
- Add SchemaDeclarationItem and ColumnDefinitionBase AST types
- Handle qualified star expressions like d.* in SELECT
- Fix INSERT target parsing to not treat column list as function params
- Add parseInsertTarget separate from parseDMLTarget
@kyleconroy kyleconroy merged commit 0b52803 into main Jan 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.

3 participants