-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathalter_function_statement.go
More file actions
86 lines (68 loc) · 2.53 KB
/
alter_function_statement.go
File metadata and controls
86 lines (68 loc) · 2.53 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
package ast
// AlterFunctionStatement represents an ALTER FUNCTION statement
type AlterFunctionStatement struct {
Name *SchemaObjectName
Parameters []*ProcedureParameter
ReturnType FunctionReturnType
Options []FunctionOptionBase
StatementList *StatementList
}
func (s *AlterFunctionStatement) statement() {}
func (s *AlterFunctionStatement) node() {}
// CreateFunctionStatement represents a CREATE FUNCTION statement
type CreateFunctionStatement struct {
Name *SchemaObjectName
Parameters []*ProcedureParameter
ReturnType FunctionReturnType
Options []FunctionOptionBase
StatementList *StatementList
}
func (s *CreateFunctionStatement) statement() {}
func (s *CreateFunctionStatement) node() {}
// FunctionReturnType is an interface for function return types
type FunctionReturnType interface {
functionReturnTypeNode()
}
// ScalarFunctionReturnType represents a scalar function return type
type ScalarFunctionReturnType struct {
DataType DataTypeReference
}
func (r *ScalarFunctionReturnType) functionReturnTypeNode() {}
// TableValuedFunctionReturnType represents a table-valued function return type
type TableValuedFunctionReturnType struct {
// Simplified - will be expanded later
}
func (r *TableValuedFunctionReturnType) functionReturnTypeNode() {}
// SelectFunctionReturnType represents a SELECT function return type (inline table-valued function)
type SelectFunctionReturnType struct {
SelectStatement *SelectStatement
}
func (r *SelectFunctionReturnType) functionReturnTypeNode() {}
// FunctionOptionBase is an interface for function options
type FunctionOptionBase interface {
Node
functionOption()
}
// FunctionOption represents a function option (like ENCRYPTION, SCHEMABINDING)
type FunctionOption struct {
OptionKind string
}
func (o *FunctionOption) node() {}
func (o *FunctionOption) functionOption() {}
// InlineFunctionOption represents an INLINE function option
type InlineFunctionOption struct {
OptionKind string // "Inline"
OptionState string // "On", "Off"
}
func (o *InlineFunctionOption) node() {}
func (o *InlineFunctionOption) functionOption() {}
// CreateOrAlterFunctionStatement represents a CREATE OR ALTER FUNCTION statement
type CreateOrAlterFunctionStatement struct {
Name *SchemaObjectName
Parameters []*ProcedureParameter
ReturnType FunctionReturnType
Options []FunctionOptionBase
StatementList *StatementList
}
func (s *CreateOrAlterFunctionStatement) statement() {}
func (s *CreateOrAlterFunctionStatement) node() {}