-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdeclare_variable_statement.go
More file actions
54 lines (43 loc) · 2.13 KB
/
declare_variable_statement.go
File metadata and controls
54 lines (43 loc) · 2.13 KB
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
package ast
// DeclareVariableStatement represents a DECLARE statement.
type DeclareVariableStatement struct {
Declarations []*DeclareVariableElement `json:"Declarations,omitempty"`
}
func (d *DeclareVariableStatement) node() {}
func (d *DeclareVariableStatement) statement() {}
// DeclareVariableElement represents a single variable declaration.
type DeclareVariableElement struct {
VariableName *Identifier `json:"VariableName,omitempty"`
DataType *SqlDataTypeReference `json:"DataType,omitempty"`
Value ScalarExpression `json:"Value,omitempty"`
Nullable *NullableConstraintDefinition `json:"Nullable,omitempty"`
}
// DeclareTableVariableStatement represents a DECLARE @var TABLE statement.
type DeclareTableVariableStatement struct {
Body *DeclareTableVariableBody `json:"Body,omitempty"`
}
func (d *DeclareTableVariableStatement) node() {}
func (d *DeclareTableVariableStatement) statement() {}
// DeclareTableVariableBody represents the body of a table variable declaration.
type DeclareTableVariableBody struct {
VariableName *Identifier `json:"VariableName,omitempty"`
AsDefined bool `json:"AsDefined,omitempty"`
Definition *TableDefinition `json:"Definition,omitempty"`
}
func (d *DeclareTableVariableBody) node() {}
// SqlDataTypeReference represents a SQL data type.
type SqlDataTypeReference struct {
SqlDataTypeOption string `json:"SqlDataTypeOption,omitempty"`
Parameters []ScalarExpression `json:"Parameters,omitempty"`
Name *SchemaObjectName `json:"Name,omitempty"`
}
func (s *SqlDataTypeReference) node() {}
func (s *SqlDataTypeReference) dataTypeReference() {}
// XmlDataTypeReference represents an XML data type with optional schema collection
type XmlDataTypeReference struct {
XmlDataTypeOption string `json:"XmlDataTypeOption,omitempty"`
XmlSchemaCollection *SchemaObjectName `json:"XmlSchemaCollection,omitempty"`
Name *SchemaObjectName `json:"Name,omitempty"`
}
func (x *XmlDataTypeReference) node() {}
func (x *XmlDataTypeReference) dataTypeReference() {}