-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcreate_user_statement.go
More file actions
78 lines (62 loc) · 2.27 KB
/
create_user_statement.go
File metadata and controls
78 lines (62 loc) · 2.27 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
package ast
// CreateUserStatement represents a CREATE USER statement
type CreateUserStatement struct {
Name *Identifier
UserLoginOption *UserLoginOption
UserOptions []UserOption
}
func (s *CreateUserStatement) statement() {}
func (s *CreateUserStatement) node() {}
// UserLoginOption represents the login option for a user
type UserLoginOption struct {
UserLoginOptionType string // "FromLogin", "WithoutLogin", "FromCertificate", "FromAsymmetricKey", "FromExternalProvider", "ForLogin"
Identifier *Identifier
}
// UserOption is an interface for user options
type UserOption interface {
userOptionNode()
}
// LiteralPrincipalOption represents a literal user option
type LiteralPrincipalOption struct {
OptionKind string
Value ScalarExpression
}
func (o *LiteralPrincipalOption) userOptionNode() {}
func (o *LiteralPrincipalOption) principalOptionNode() {}
// IdentifierPrincipalOption represents an identifier-based user option
type IdentifierPrincipalOption struct {
OptionKind string
Identifier *Identifier
}
func (o *IdentifierPrincipalOption) userOptionNode() {}
func (o *IdentifierPrincipalOption) principalOptionNode() {}
// OnOffPrincipalOption represents an ON/OFF principal option
type OnOffPrincipalOption struct {
OptionKind string
OptionState string // "On" or "Off"
}
func (o *OnOffPrincipalOption) userOptionNode() {}
func (o *OnOffPrincipalOption) principalOptionNode() {}
// PrincipalOptionSimple represents a simple principal option with just an option kind
type PrincipalOptionSimple struct {
OptionKind string
}
func (o *PrincipalOptionSimple) userOptionNode() {}
func (o *PrincipalOptionSimple) principalOptionNode() {}
// DefaultSchemaPrincipalOption represents a default schema option
type DefaultSchemaPrincipalOption struct {
OptionKind string
Identifier *Identifier
}
func (o *DefaultSchemaPrincipalOption) userOptionNode() {}
// PasswordAlterPrincipalOption represents a password option for ALTER USER/LOGIN
type PasswordAlterPrincipalOption struct {
Password ScalarExpression
OldPassword *StringLiteral
MustChange bool
Unlock bool
Hashed bool
OptionKind string
}
func (o *PasswordAlterPrincipalOption) userOptionNode() {}
func (o *PasswordAlterPrincipalOption) principalOptionNode() {}