-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfunction_call.go
More file actions
97 lines (77 loc) · 3.34 KB
/
function_call.go
File metadata and controls
97 lines (77 loc) · 3.34 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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
package ast
// CallTarget represents a call target for a function call.
type CallTarget interface {
callTarget()
}
// MultiPartIdentifierCallTarget represents a multi-part identifier call target.
type MultiPartIdentifierCallTarget struct {
MultiPartIdentifier *MultiPartIdentifier
}
func (*MultiPartIdentifierCallTarget) callTarget() {}
// ExpressionCallTarget represents an expression call target.
type ExpressionCallTarget struct {
Expression ScalarExpression
}
func (*ExpressionCallTarget) callTarget() {}
// UserDefinedTypeCallTarget represents a user-defined type call target.
type UserDefinedTypeCallTarget struct {
SchemaObjectName *SchemaObjectName
}
func (*UserDefinedTypeCallTarget) callTarget() {}
// OverClause represents an OVER clause for window functions.
type OverClause struct {
// Add partition by, order by, and window frame as needed
}
// WithinGroupClause represents a WITHIN GROUP clause for ordered set aggregate functions.
type WithinGroupClause struct {
OrderByClause *OrderByClause `json:"OrderByClause,omitempty"`
HasGraphPath bool `json:"HasGraphPath,omitempty"`
}
func (*WithinGroupClause) node() {}
// FunctionCall represents a function call.
type FunctionCall struct {
CallTarget CallTarget `json:"CallTarget,omitempty"`
FunctionName *Identifier `json:"FunctionName,omitempty"`
Parameters []ScalarExpression `json:"Parameters,omitempty"`
UniqueRowFilter string `json:"UniqueRowFilter,omitempty"`
WithinGroupClause *WithinGroupClause `json:"WithinGroupClause,omitempty"`
OverClause *OverClause `json:"OverClause,omitempty"`
IgnoreRespectNulls []*Identifier `json:"IgnoreRespectNulls,omitempty"`
WithArrayWrapper bool `json:"WithArrayWrapper,omitempty"`
}
func (*FunctionCall) node() {}
func (*FunctionCall) scalarExpression() {}
// CastCall represents a CAST expression: CAST(expression AS data_type)
type CastCall struct {
DataType DataTypeReference `json:"DataType,omitempty"`
Parameter ScalarExpression `json:"Parameter,omitempty"`
Collation *Identifier `json:"Collation,omitempty"`
}
func (*CastCall) node() {}
func (*CastCall) scalarExpression() {}
// ConvertCall represents a CONVERT expression: CONVERT(data_type, expression [, style])
type ConvertCall struct {
DataType DataTypeReference `json:"DataType,omitempty"`
Parameter ScalarExpression `json:"Parameter,omitempty"`
Style ScalarExpression `json:"Style,omitempty"`
Collation *Identifier `json:"Collation,omitempty"`
}
func (*ConvertCall) node() {}
func (*ConvertCall) scalarExpression() {}
// TryCastCall represents a TRY_CAST expression
type TryCastCall struct {
DataType DataTypeReference `json:"DataType,omitempty"`
Parameter ScalarExpression `json:"Parameter,omitempty"`
Collation *Identifier `json:"Collation,omitempty"`
}
func (*TryCastCall) node() {}
func (*TryCastCall) scalarExpression() {}
// TryConvertCall represents a TRY_CONVERT expression
type TryConvertCall struct {
DataType DataTypeReference `json:"DataType,omitempty"`
Parameter ScalarExpression `json:"Parameter,omitempty"`
Style ScalarExpression `json:"Style,omitempty"`
Collation *Identifier `json:"Collation,omitempty"`
}
func (*TryConvertCall) node() {}
func (*TryConvertCall) scalarExpression() {}