Skip to content

Commit 73aa6f6

Browse files
authored
Enable 81 more PhaseOne tests with comprehensive parser improvements (#12)
1 parent bfb5b28 commit 73aa6f6

File tree

295 files changed

+5354
-465
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

295 files changed

+5354
-465
lines changed

ast/alter_database_set_statement.go

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,3 +34,64 @@ type OnOffDatabaseOption struct {
3434

3535
func (o *OnOffDatabaseOption) node() {}
3636
func (o *OnOffDatabaseOption) databaseOption() {}
37+
38+
// AlterDatabaseAddFileStatement represents ALTER DATABASE ... ADD FILE statement
39+
type AlterDatabaseAddFileStatement struct {
40+
DatabaseName *Identifier
41+
}
42+
43+
func (a *AlterDatabaseAddFileStatement) node() {}
44+
func (a *AlterDatabaseAddFileStatement) statement() {}
45+
46+
// AlterDatabaseAddFileGroupStatement represents ALTER DATABASE ... ADD FILEGROUP statement
47+
type AlterDatabaseAddFileGroupStatement struct {
48+
DatabaseName *Identifier
49+
FileGroupName *Identifier
50+
}
51+
52+
func (a *AlterDatabaseAddFileGroupStatement) node() {}
53+
func (a *AlterDatabaseAddFileGroupStatement) statement() {}
54+
55+
// AlterDatabaseModifyFileStatement represents ALTER DATABASE ... MODIFY FILE statement
56+
type AlterDatabaseModifyFileStatement struct {
57+
DatabaseName *Identifier
58+
}
59+
60+
func (a *AlterDatabaseModifyFileStatement) node() {}
61+
func (a *AlterDatabaseModifyFileStatement) statement() {}
62+
63+
// AlterDatabaseModifyFileGroupStatement represents ALTER DATABASE ... MODIFY FILEGROUP statement
64+
type AlterDatabaseModifyFileGroupStatement struct {
65+
DatabaseName *Identifier
66+
FileGroupName *Identifier
67+
}
68+
69+
func (a *AlterDatabaseModifyFileGroupStatement) node() {}
70+
func (a *AlterDatabaseModifyFileGroupStatement) statement() {}
71+
72+
// AlterDatabaseModifyNameStatement represents ALTER DATABASE ... MODIFY NAME statement
73+
type AlterDatabaseModifyNameStatement struct {
74+
DatabaseName *Identifier
75+
NewName *Identifier
76+
}
77+
78+
func (a *AlterDatabaseModifyNameStatement) node() {}
79+
func (a *AlterDatabaseModifyNameStatement) statement() {}
80+
81+
// AlterDatabaseRemoveFileStatement represents ALTER DATABASE ... REMOVE FILE statement
82+
type AlterDatabaseRemoveFileStatement struct {
83+
DatabaseName *Identifier
84+
FileName *Identifier
85+
}
86+
87+
func (a *AlterDatabaseRemoveFileStatement) node() {}
88+
func (a *AlterDatabaseRemoveFileStatement) statement() {}
89+
90+
// AlterDatabaseRemoveFileGroupStatement represents ALTER DATABASE ... REMOVE FILEGROUP statement
91+
type AlterDatabaseRemoveFileGroupStatement struct {
92+
DatabaseName *Identifier
93+
FileGroupName *Identifier
94+
}
95+
96+
func (a *AlterDatabaseRemoveFileGroupStatement) node() {}
97+
func (a *AlterDatabaseRemoveFileGroupStatement) statement() {}

ast/alter_function_statement.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,18 @@ type AlterFunctionStatement struct {
1212
func (s *AlterFunctionStatement) statement() {}
1313
func (s *AlterFunctionStatement) node() {}
1414

15+
// CreateFunctionStatement represents a CREATE FUNCTION statement
16+
type CreateFunctionStatement struct {
17+
Name *SchemaObjectName
18+
Parameters []*ProcedureParameter
19+
ReturnType FunctionReturnType
20+
Options []*FunctionOption
21+
StatementList *StatementList
22+
}
23+
24+
func (s *CreateFunctionStatement) statement() {}
25+
func (s *CreateFunctionStatement) node() {}
26+
1527
// FunctionReturnType is an interface for function return types
1628
type FunctionReturnType interface {
1729
functionReturnTypeNode()

ast/alter_simple_statements.go

Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
1+
package ast
2+
3+
// AlterRouteStatement represents an ALTER ROUTE statement.
4+
type AlterRouteStatement struct {
5+
Name *Identifier `json:"Name,omitempty"`
6+
}
7+
8+
func (s *AlterRouteStatement) node() {}
9+
func (s *AlterRouteStatement) statement() {}
10+
11+
// AlterAssemblyStatement represents an ALTER ASSEMBLY statement.
12+
type AlterAssemblyStatement struct {
13+
Name *Identifier `json:"Name,omitempty"`
14+
}
15+
16+
func (s *AlterAssemblyStatement) node() {}
17+
func (s *AlterAssemblyStatement) statement() {}
18+
19+
// AlterEndpointStatement represents an ALTER ENDPOINT statement.
20+
type AlterEndpointStatement struct {
21+
Name *Identifier `json:"Name,omitempty"`
22+
}
23+
24+
func (s *AlterEndpointStatement) node() {}
25+
func (s *AlterEndpointStatement) statement() {}
26+
27+
// AlterServiceStatement represents an ALTER SERVICE statement.
28+
type AlterServiceStatement struct {
29+
Name *Identifier `json:"Name,omitempty"`
30+
}
31+
32+
func (s *AlterServiceStatement) node() {}
33+
func (s *AlterServiceStatement) statement() {}
34+
35+
// AlterCertificateStatement represents an ALTER CERTIFICATE statement.
36+
type AlterCertificateStatement struct {
37+
Name *Identifier `json:"Name,omitempty"`
38+
}
39+
40+
func (s *AlterCertificateStatement) node() {}
41+
func (s *AlterCertificateStatement) statement() {}
42+
43+
// AlterApplicationRoleStatement represents an ALTER APPLICATION ROLE statement.
44+
type AlterApplicationRoleStatement struct {
45+
Name *Identifier `json:"Name,omitempty"`
46+
}
47+
48+
func (s *AlterApplicationRoleStatement) node() {}
49+
func (s *AlterApplicationRoleStatement) statement() {}
50+
51+
// AlterAsymmetricKeyStatement represents an ALTER ASYMMETRIC KEY statement.
52+
type AlterAsymmetricKeyStatement struct {
53+
Name *Identifier `json:"Name,omitempty"`
54+
}
55+
56+
func (s *AlterAsymmetricKeyStatement) node() {}
57+
func (s *AlterAsymmetricKeyStatement) statement() {}
58+
59+
// AlterQueueStatement represents an ALTER QUEUE statement.
60+
type AlterQueueStatement struct {
61+
Name *SchemaObjectName `json:"Name,omitempty"`
62+
}
63+
64+
func (s *AlterQueueStatement) node() {}
65+
func (s *AlterQueueStatement) statement() {}
66+
67+
// AlterPartitionSchemeStatement represents an ALTER PARTITION SCHEME statement.
68+
type AlterPartitionSchemeStatement struct {
69+
Name *Identifier `json:"Name,omitempty"`
70+
}
71+
72+
func (s *AlterPartitionSchemeStatement) node() {}
73+
func (s *AlterPartitionSchemeStatement) statement() {}
74+
75+
// AlterPartitionFunctionStatement represents an ALTER PARTITION FUNCTION statement.
76+
type AlterPartitionFunctionStatement struct {
77+
Name *Identifier `json:"Name,omitempty"`
78+
}
79+
80+
func (s *AlterPartitionFunctionStatement) node() {}
81+
func (s *AlterPartitionFunctionStatement) statement() {}
82+
83+
// AlterFulltextCatalogStatement represents an ALTER FULLTEXT CATALOG statement.
84+
type AlterFulltextCatalogStatement struct {
85+
Name *Identifier `json:"Name,omitempty"`
86+
}
87+
88+
func (s *AlterFulltextCatalogStatement) node() {}
89+
func (s *AlterFulltextCatalogStatement) statement() {}
90+
91+
// AlterFulltextIndexStatement represents an ALTER FULLTEXT INDEX statement.
92+
type AlterFulltextIndexStatement struct {
93+
OnName *SchemaObjectName `json:"OnName,omitempty"`
94+
}
95+
96+
func (s *AlterFulltextIndexStatement) node() {}
97+
func (s *AlterFulltextIndexStatement) statement() {}
98+
99+
// AlterSymmetricKeyStatement represents an ALTER SYMMETRIC KEY statement.
100+
type AlterSymmetricKeyStatement struct {
101+
Name *Identifier `json:"Name,omitempty"`
102+
}
103+
104+
func (s *AlterSymmetricKeyStatement) node() {}
105+
func (s *AlterSymmetricKeyStatement) statement() {}
106+
107+
// AlterServiceMasterKeyStatement represents an ALTER SERVICE MASTER KEY statement.
108+
type AlterServiceMasterKeyStatement struct {
109+
}
110+
111+
func (s *AlterServiceMasterKeyStatement) node() {}
112+
func (s *AlterServiceMasterKeyStatement) statement() {}

ast/alter_user_statement.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
package ast
2+
3+
// AlterUserStatement represents an ALTER USER statement.
4+
type AlterUserStatement struct {
5+
Name *Identifier `json:"Name,omitempty"`
6+
Options []UserOption `json:"Options,omitempty"`
7+
}
8+
9+
func (s *AlterUserStatement) node() {}
10+
func (s *AlterUserStatement) statement() {}

ast/bulk_insert_statement.go

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
package ast
2+
3+
// InsertBulkStatement represents an INSERT BULK statement.
4+
type InsertBulkStatement struct {
5+
To *SchemaObjectName `json:"To,omitempty"`
6+
ColumnDefinitions []*InsertBulkColumnDefinition `json:"ColumnDefinitions,omitempty"`
7+
Options []BulkInsertOption `json:"Options,omitempty"`
8+
}
9+
10+
func (i *InsertBulkStatement) node() {}
11+
func (i *InsertBulkStatement) statement() {}
12+
13+
// BulkInsertStatement represents a BULK INSERT statement.
14+
type BulkInsertStatement struct {
15+
From *IdentifierOrValueExpression `json:"From,omitempty"`
16+
To *SchemaObjectName `json:"To,omitempty"`
17+
Options []BulkInsertOption `json:"Options,omitempty"`
18+
}
19+
20+
func (b *BulkInsertStatement) node() {}
21+
func (b *BulkInsertStatement) statement() {}
22+
23+
// InsertBulkColumnDefinition represents a column definition in INSERT BULK.
24+
type InsertBulkColumnDefinition struct {
25+
Column *ColumnDefinitionBase `json:"Column,omitempty"`
26+
NullNotNull string `json:"NullNotNull,omitempty"` // "Null", "NotNull", "Unspecified"
27+
}
28+
29+
// ColumnDefinitionBase represents a basic column definition.
30+
type ColumnDefinitionBase struct {
31+
ColumnIdentifier *Identifier `json:"ColumnIdentifier,omitempty"`
32+
DataType DataTypeReference `json:"DataType,omitempty"`
33+
}
34+
35+
// BulkInsertOption is the interface for bulk insert options.
36+
type BulkInsertOption interface {
37+
bulkInsertOption()
38+
}
39+
40+
// BulkInsertOptionBase represents a simple bulk insert option.
41+
type BulkInsertOptionBase struct {
42+
OptionKind string `json:"OptionKind,omitempty"`
43+
}
44+
45+
func (b *BulkInsertOptionBase) bulkInsertOption() {}
46+
47+
// LiteralBulkInsertOption represents a bulk insert option with a literal value.
48+
type LiteralBulkInsertOption struct {
49+
Value ScalarExpression `json:"Value,omitempty"`
50+
OptionKind string `json:"OptionKind,omitempty"`
51+
}
52+
53+
func (l *LiteralBulkInsertOption) bulkInsertOption() {}
54+
55+
// OrderBulkInsertOption represents an ORDER bulk insert option.
56+
type OrderBulkInsertOption struct {
57+
Columns []*ColumnWithSortOrder `json:"Columns,omitempty"`
58+
IsUnique bool `json:"IsUnique,omitempty"`
59+
OptionKind string `json:"OptionKind,omitempty"`
60+
}
61+
62+
func (o *OrderBulkInsertOption) bulkInsertOption() {}
63+
64+
// Note: ColumnWithSortOrder is defined in create_table_statement.go

0 commit comments

Comments
 (0)