Skip to content

Conversation

@kyleconroy
Copy link
Collaborator

Fix inconsistent ast.json by adding UseCurrent: false to match
other AlterDatabaseModifyFileStatement tests in the codebase.

claude added 30 commits January 3, 2026 01:22
Fix inconsistent ast.json by adding UseCurrent: false to match
other AlterDatabaseModifyFileStatement tests in the codebase.
Fix inconsistent ast.json by adding UseCurrent: false to match
other AlterDatabaseRemoveFileStatement tests in the codebase.
Fix inconsistent ast.json by adding UseCurrent: false to match
other AlterDatabaseModifyNameStatement tests in the codebase.
Fix inconsistent ast.json by adding UpdatabilityOption: None to match
other AlterDatabaseModifyFileGroupStatement tests in the codebase.
Fix inconsistent ast.json by adding UpdatabilityOption: None to match
other AlterDatabaseModifyFileGroupStatement tests in the codebase.
Implements parsing for:
- CONTAINS (column/PROPERTY, value) predicate
- FREETEXT (column, value) predicate
- EXISTS (subquery) predicate

These are used in WHERE clauses for full-text search and subquery existence checks.
Implements parsing for:
- IIF(condition, true_value, false_value) function
- PARSE(string AS type [USING culture]) function
- TRY_PARSE(string AS type [USING culture]) function

These are SQL Server 2012+ functions for conditional expressions and culture-aware parsing.
Fix inconsistent ast.json by using CreateFullTextCatalogStatement with
IsDefault: false to match other CreateFullTextCatalog tests. Also update
metadata.json from invalid_syntax to enabled.
Fix FullTextPredicate to use PascalCase for FullTextFunctionType:
- "CONTAINS" -> "Contains"
- "FREETEXT" -> "FreeText"

This enables the expression tests that test CONTAINS, FREETEXT, IIF,
PARSE, TRY_PARSE, and other SQL Server 2012+ expressions.
- Add parsing for NULL/NOT NULL nullability in function parameters
- Fix NativeCompilation and SchemaBinding option naming in parseFunctionOptions
- Enables NativelyCompiledScalarUDFTests130 tests
- Add @varname support for multi-statement table-valued function return types
- Add column constraint parsing (PRIMARY KEY, NOT NULL, NULL) in table definitions
- Add multi-statement table-valued function body parsing
- Handle parenthesized WITH XMLNAMESPACES in SELECT statements
- Enables CreateFunctionStatementTests90 and FunctionStatementTests tests
- Add string literal alias without AS (e.g., expr 'alias')
- Add national string literal alias without AS (e.g., expr N'alias')
- Add equals-style alias (e.g., column1 = expr, [column1] = expr, 'alias' = expr)
- Enables SelectExpressionTests
- Add COLUMNSTORE keyword support to parseInlineIndexDefinition
  (CLUSTERED COLUMNSTORE, NONCLUSTERED COLUMNSTORE, implicit COLUMNSTORE)
- Add WHERE clause parsing for filtered indexes in inline index definitions
- Add COMPRESSION_DELAY option parsing with time units (Unitless, Minute, Minutes)
- Add FilterPredicate field to IndexDefinition struct

Enables ColumnStoreInlineIndex130 test.
- Enhance column-level INDEX parsing to handle UNIQUE keyword
- Add HASH keyword support after CLUSTERED/NONCLUSTERED in column INDEX
- Add WITH clause parsing with BUCKET_COUNT option for column INDEX
- Add DurabilityTableOption AST type for DURABILITY table option
- Add DURABILITY table option parsing (SchemaOnly, SchemaAndData)
- Add DurabilityTableOption marshaling

Enables Baselines130_UniqueInlineIndex130 test.
…upport

- Add AlterTableRebuildStatement with PARTITION and IndexOptions support
- Add AlterTableChangeTrackingModificationStatement for ENABLE/DISABLE CHANGE_TRACKING
- Add LockEscalationTableOption and FileStreamOnTableOption for ALTER TABLE SET
- Enhance ALTER COLUMN to support ADD/DROP SPARSE options
- Add SPARSE, FILESTREAM, and COLUMN_SET FOR ALL_SPARSE_COLUMNS parsing
- Add StorageOptions field to AlterTableAlterColumnStatement
- Add marshaling for all new statement types and table options
Use parseDataTypeReference() instead of parseDataType() to correctly
handle XmlDataTypeReference. The parseDataType() wrapper was discarding
non-SqlDataTypeReference types and returning an empty SqlDataTypeReference.

Enables Baselines100_AlterTableStatementTests100 test.
- Add FilterPredicate and FileStreamOn fields to CreateIndexStatement
- Add DATA_COMPRESSION option with ON PARTITIONS support to parseCreateIndexOptions
- Add pseudo column handling ($ACTION, $IDENTITY, $ROWGUID, $CUID) in parsePrimaryExpression
- Add JSON marshaling for FilterPredicate and FileStreamOn
- Enable CreateIndexStatementTests100 and Baselines100_CreateIndexStatementTests100
- Add default value parsing (=value) for function parameters
- Add EXECUTE AS (SELF/OWNER/CALLER/String) option parsing for CREATE OR ALTER FUNCTION
- Fix SCHEMABINDING option capitalization to SchemaBinding
- Enable ScalarFunctionTestsFabricDW and BaselinesFabricDW_ScalarFunctionTestsFabricDW
- Add standalone HASH keyword parsing for inline indexes (treated as
  NonClusteredHash)
- Add OnFileGroupOrPartitionScheme and FileStreamOn fields to
  IndexDefinition AST
- Add JSON marshaling for these fields in indexDefinitionToJSON
- Comprehensive inline index options parsing including PAD_INDEX,
  FILLFACTOR, IGNORE_DUP_KEY, STATISTICS_NORECOMPUTE, ALLOW_ROW_LOCKS,
  ALLOW_PAGE_LOCKS, BUCKET_COUNT, DATA_COMPRESSION with ON PARTITIONS

Fixes ColumnDefinitionTests120 and Baselines120_ColumnDefinitionTests120
- Add AST types for audit specification statements:
  - CreateServerAuditSpecificationStatement
  - AlterServerAuditSpecificationStatement
  - CreateDatabaseAuditSpecificationStatement
  - AlterDatabaseAuditSpecificationStatement
  - AuditSpecificationPart
  - AuditActionGroupReference

- Add parsing for SPECIFICATION keyword after SERVER AUDIT and DATABASE AUDIT
- Add FOR SERVER AUDIT, ADD/DROP parts, and WITH STATE parsing
- Add convertAuditGroupName helper for mapping audit group names
- Add JSON marshaling for all new types

Fixes AuditSpecificationStatementTests110 and Baselines110_AuditSpecificationStatementTests110
- Add SelectStatement field to CreateExternalTableStatement for CTAS syntax
- Add ExternalTableOptionItem interface for polymorphic option handling
- Add ExternalTableRejectTypeOption for REJECT_TYPE option parsing
- Add parsing for REJECT_TYPE, REJECT_VALUE, REJECT_SAMPLE_VALUE options
- Add AS SELECT clause parsing in external table statements
- Add DropResourcePoolStatement AST type
- Add parsing for DROP RESOURCE POOL in parseDropStatement
- Add JSON marshaling for DropResourcePoolStatement
Partial progress toward ALTER TABLE ADD statement improvements:
- Add Column field for table-level DEFAULT constraints (DEFAULT ... FOR column)
- Add WithValues field for DEFAULT with WITH VALUES clause
- Add tableConstraint() method to DefaultConstraintDefinition
- Update WITH VALUES parsing in column DEFAULT handling
- Update defaultConstraintToJSON marshaling
- Add AlterViewStatement AST type with IsRebuild, IsDisable, IsMaterialized fields
- Add ALTER VIEW parsing in parseAlterStatement (parse_ddl.go)
- Add alterViewStatementToJSON marshaling function
- Fix view options parsing to handle keyword tokens (ENCRYPTION)
- Map view options to proper OptionKind values (Encryption, SchemaBinding, ViewMetadata)
- Add WITH CHECK OPTION parsing after SELECT statement
- Fix table hint parsing to only consume WITH when followed by (
- Fix double-quoted identifier handling in parseColumnReferenceOrFunctionCall

This enables ViewStatementTests, Baselines80_ViewStatementTests, and
Baselines90_ViewStatementTests.
- Add loop for comma-separated elements in parseAlterTableAddStatement
- Add table-level CHECK constraint parsing without CONSTRAINT keyword
- Handle WITH CHECK/NOCHECK ADD statements properly
- Add ON DELETE/UPDATE actions for FOREIGN KEY constraints
- Add NOT FOR REPLICATION parsing for foreign keys
- Add ON filegroup parsing for PRIMARY KEY and UNIQUE constraints

Baselines90_AlterTableAddTableElementStatementTests still needs:
- DEFAULT ... FOR column with WITH VALUES
- COLLATE for columns
- Computed column expressions (AS ... UNIQUE)
- Additional constraint parsing features
- Add DEFAULT and CHECK cases to CONSTRAINT parsing in parseAlterTableAddStatement
- Add DefaultConstraintDefinition case to tableConstraintToJSON marshaling
- Remove hasColumnsFK requirement for FOREIGN KEY (columns are optional)
- Handle incomplete DEFAULT constraints gracefully
- Enables Baselines90_AlterTableAddTableElementStatementTests
- Add Columns field to SecurityTargetObject for column-level permissions
- Fix object name parsing to handle ..name syntax without ::
- Add column list parsing after object name in GRANT/REVOKE/DENY
- Update securityTargetObjectToJSON to marshal Columns field
- Add AsClause field to GrantStatement for AS identifier clause
- Add TokenAll, TokenDefault, TokenTrigger, TokenSchema to permission parsing
- Add column list parsing for permissions (e.g., SELECT (c1, c2))
- Synchronize permission token handling across GRANT, REVOKE, DENY parsers
- Update grantStatementToJSON to marshal AsClause field
- Enables 3 tests: SecurityStatement80Tests, Baselines80_*, Baselines90_*
- Handle WITH FILLFACTOR = 25 syntax (no parentheses)
- Parse index options until ON (filegroup) keyword is encountered
- Applies to both UNIQUE and PRIMARY KEY constraints
- Enables 2 tests: AlterTableAddTableElementStatementTests, Baselines80_*
Add parsing for:
- Termination clause (WITH NO_WAIT, WITH ROLLBACK AFTER N, WITH ROLLBACK IMMEDIATE)
- CURSOR_CLOSE_ON_COMMIT ON/OFF option
- CURSOR_DEFAULT LOCAL/GLOBAL option
- RecoveryDatabaseOption for RECOVERY FULL/BULK_LOGGED/SIMPLE
- Fix capitalization for ArithAbort and NumericRoundAbort option kinds
claude added 15 commits January 3, 2026 18:44
Add parsing for:
- MAX_CPU_PERCENT, MAX_MEMORY_PERCENT, MAX_PROCESSES parameters
- AFFINITY CPU/NUMANODE with AUTO or range specifications
Add IF EXISTS parsing for:
- DROP SEQUENCE IF EXISTS
- ALTER TABLE DROP CONSTRAINT IF EXISTS
- ALTER TABLE DROP COLUMN IF EXISTS
Also add WithNoDependents field to DropAssemblyStatement
- Add CreateAvailabilityGroupStatement AST type with full replica parsing
- Support REQUIRED_COPIES_TO_COMMIT option
- Parse replica options: AVAILABILITY_MODE, FAILOVER_MODE, ENDPOINT_URL,
  SESSION_TIMEOUT, APPLY_DELAY
- Parse role-based options: PRIMARY_ROLE and SECONDARY_ROLE with ALLOW_CONNECTIONS
- Add marshaling functions for all new types
- Enable 2 passing tests
- Add BackupEncryptionOption and BackupOptionBase interface
- Support ENCRYPTION(ALGORITHM = ..., SERVER CERTIFICATE|ASYMMETRIC KEY = ...)
- Reuse existing CryptoMechanism type
- Add Stats option kind capitalization
- Enable 1 passing test
- Add SubqueryComparisonPredicate AST type for subquery comparisons
- Parse SOME/ANY/ALL with subqueries after IS [NOT] DISTINCT FROM
- Add marshaling for SubqueryComparisonPredicate
- Enable 2 passing tests
- Support ADD HIDDEN and DROP HIDDEN column options
- Parse HIDDEN modifier in column definitions
- Add ColumnEncryptionDefinition and related parameter types
- Parse ENCRYPTED WITH (...) specifications
- Parse MASKED WITH (FUNCTION = ...) specifications
- Add MaskingFunction and Encryption fields to AlterTableAlterColumnStatement
- Add marshaling for encryption parameter types
- Enable 2 passing tests
- Add SERVICE_OBJECTIVE option parsing for Azure databases
- Add ElasticPoolSpecification AST type for elastic pool syntax
- Parse ELASTIC_POOL(NAME = poolname) syntax
- Support options after AS COPY OF clause
- Add marshaling for ElasticPoolSpecification
- Enable 2 passing tests
Support for:
- REMOTE_DATA_ARCHIVE = ON/OFF/OFF_WITHOUT_DATA_RECOVERY
- MIGRATION_STATE = PAUSED/OUTBOUND/INBOUND
- FILTER_PREDICATE = NULL or function call
- Add RetentionDaysAuditTargetOption AST type
- Fix EXTERNAL_MONITOR target kind to return "ExternalMonitor"
- Add URL target kind support
- Add Options field to AlterProcedureStatement for WITH clause
- Add NATIVE_COMPILATION and SCHEMABINDING procedure option parsing
- Fix BEGIN ATOMIC block to handle multi-word isolation levels
- Add OnOffAtomicBlockOption for DELAYED_DURABILITY
- Fix DATEFIRST (IntegerLiteral) and DATEFORMAT (StringLiteral) types
- Add PageVerifyDatabaseOption, PartnerDatabaseOption, WitnessDatabaseOption
- Add ParameterizationDatabaseOption, GenericDatabaseOption AST types
- Add parsing for EMERGENCY, PAGE_VERIFY, PARTNER, WITNESS, PARAMETERIZATION
- Add broker options (ENABLE_BROKER, DISABLE_BROKER, etc.)
- Fix DB_CHAINING capitalization to DBChaining
…upport

- Add ON DELETE/UPDATE action parsing (CASCADE, NO ACTION, SET NULL, SET DEFAULT)
- Add NOT FOR REPLICATION parsing
- Add parseForeignKeyAction helper function
@kyleconroy kyleconroy merged commit 6872611 into main Jan 4, 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