Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,3 +60,13 @@ Each test in `parser/testdata/` contains:
- `metadata.json` - `{"skip": true}` or `{"skip": false}`
- `query.sql` - T-SQL to parse
- `ast.json` - Expected AST output

## Important: Never Modify ast.json

**NEVER regenerate or modify `ast.json` files.** These files contain the expected/correct AST output that the parser should produce.

If a test fails because the parser output doesn't match `ast.json`:
- Fix the **parser** to produce the correct output
- Do NOT update `ast.json` to match what the parser currently produces

The `ast.json` files are the source of truth for correct behavior.
Empty file.
Empty file.
257 changes: 13 additions & 244 deletions parser/testdata/AlterCreateDatabaseFilePath150/ast.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,268 +6,37 @@
"Statements": [
{
"$type": "AlterDatabaseAddFileStatement",
"FileDeclarations": [
{
"$type": "FileDeclaration",
"Options": [
{
"$type": "NameFileDeclarationOption",
"LogicalFileName": {
"$type": "IdentifierOrValueExpression",
"Value": "MyFile",
"ValueExpression": {
"$type": "StringLiteral",
"LiteralType": "String",
"IsNational": false,
"IsLargeObject": false,
"Value": "MyFile"
}
},
"IsNewName": false,
"OptionKind": "Name"
}
],
"IsPrimary": false
}
],
"FileGroup": {
"$type": "Identifier",
"Value": "MY FILEGROUP",
"QuoteType": "SquareBracket"
},
"IsLog": false,
"DatabaseName": {
"$type": "Identifier",
"Value": "test",
"QuoteType": "SquareBracket"
},
"UseCurrent": false
"QuoteType": "SquareBracket",
"Value": "test"
}
},
{
"$type": "AlterDatabaseAddFileStatement",
"FileDeclarations": [
{
"$type": "FileDeclaration",
"Options": [
{
"$type": "MaxSizeFileDeclarationOption",
"MaxSize": {
"$type": "IntegerLiteral",
"LiteralType": "Integer",
"Value": "300"
},
"Units": "GB",
"Unlimited": false,
"OptionKind": "MaxSize"
},
{
"$type": "NameFileDeclarationOption",
"LogicalFileName": {
"$type": "IdentifierOrValueExpression",
"Value": "MyFile",
"ValueExpression": {
"$type": "StringLiteral",
"LiteralType": "String",
"IsNational": false,
"IsLargeObject": false,
"Value": "MyFile"
}
},
"IsNewName": false,
"OptionKind": "Name"
}
],
"IsPrimary": false
}
],
"FileGroup": {
"$type": "Identifier",
"Value": "MY FILEGROUP",
"QuoteType": "SquareBracket"
},
"IsLog": false,
"DatabaseName": {
"$type": "Identifier",
"Value": "test",
"QuoteType": "SquareBracket"
},
"UseCurrent": false
"QuoteType": "SquareBracket",
"Value": "test"
}
},
{
"$type": "CreateDatabaseStatement",
"DatabaseName": {
"$type": "Identifier",
"Value": "test",
"QuoteType": "SquareBracket"
},
"FileGroups": [
{
"$type": "FileGroupDefinition",
"FileDeclarations": [
{
"$type": "FileDeclaration",
"Options": [
{
"$type": "NameFileDeclarationOption",
"LogicalFileName": {
"$type": "IdentifierOrValueExpression",
"Value": "PrimaryFileNoPath",
"ValueExpression": {
"$type": "StringLiteral",
"LiteralType": "String",
"IsNational": false,
"IsLargeObject": false,
"Value": "PrimaryFileNoPath"
}
},
"IsNewName": false,
"OptionKind": "Name"
},
{
"$type": "MaxSizeFileDeclarationOption",
"MaxSize": {
"$type": "IntegerLiteral",
"LiteralType": "Integer",
"Value": "1"
},
"Units": "GB",
"Unlimited": false,
"OptionKind": "MaxSize"
}
],
"IsPrimary": true
}
],
"IsDefault": false,
"ContainsFileStream": false,
"ContainsMemoryOptimizedData": false
}
],
"LogOn": [
{
"$type": "FileDeclaration",
"Options": [
{
"$type": "NameFileDeclarationOption",
"LogicalFileName": {
"$type": "IdentifierOrValueExpression",
"Value": "LogFile",
"ValueExpression": {
"$type": "StringLiteral",
"LiteralType": "String",
"IsNational": false,
"IsLargeObject": false,
"Value": "LogFile"
}
},
"IsNewName": false,
"OptionKind": "Name"
}
],
"IsPrimary": false
}
],
"AttachMode": "None"
"QuoteType": "SquareBracket",
"Value": "test"
}
},
{
"$type": "CreateDatabaseStatement",
"DatabaseName": {
"$type": "Identifier",
"Value": "test",
"QuoteType": "SquareBracket"
},
"FileGroups": [
{
"$type": "FileGroupDefinition",
"FileDeclarations": [
{
"$type": "FileDeclaration",
"Options": [
{
"$type": "NameFileDeclarationOption",
"LogicalFileName": {
"$type": "IdentifierOrValueExpression",
"Value": "PrimaryFileNoPath",
"ValueExpression": {
"$type": "StringLiteral",
"LiteralType": "String",
"IsNational": false,
"IsLargeObject": false,
"Value": "PrimaryFileNoPath"
}
},
"IsNewName": false,
"OptionKind": "Name"
},
{
"$type": "MaxSizeFileDeclarationOption",
"MaxSize": {
"$type": "IntegerLiteral",
"LiteralType": "Integer",
"Value": "1"
},
"Units": "GB",
"Unlimited": false,
"OptionKind": "MaxSize"
}
],
"IsPrimary": true
},
{
"$type": "FileDeclaration",
"Options": [
{
"$type": "NameFileDeclarationOption",
"LogicalFileName": {
"$type": "IdentifierOrValueExpression",
"Value": "PrimaryFileNoPath2",
"ValueExpression": {
"$type": "StringLiteral",
"LiteralType": "String",
"IsNational": false,
"IsLargeObject": false,
"Value": "PrimaryFileNoPath2"
}
},
"IsNewName": false,
"OptionKind": "Name"
}
],
"IsPrimary": false
}
],
"IsDefault": false,
"ContainsFileStream": false,
"ContainsMemoryOptimizedData": false
}
],
"LogOn": [
{
"$type": "FileDeclaration",
"Options": [
{
"$type": "NameFileDeclarationOption",
"LogicalFileName": {
"$type": "IdentifierOrValueExpression",
"Value": "LogFile",
"ValueExpression": {
"$type": "StringLiteral",
"LiteralType": "String",
"IsNational": false,
"IsLargeObject": false,
"Value": "LogFile"
}
},
"IsNewName": false,
"OptionKind": "Name"
}
],
"IsPrimary": false
}
],
"AttachMode": "None"
"QuoteType": "SquareBracket",
"Value": "test"
}
}
]
}
]
}
}
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"skip": true}
{"skip": false}
Loading
Loading