-
Notifications
You must be signed in to change notification settings - Fork 427
/
Copy pathdatabase_role_gen.go
46 lines (38 loc) · 1.85 KB
/
database_role_gen.go
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
package example
import "context"
type DatabaseRoles interface {
Create(ctx context.Context, request *CreateDatabaseRoleRequest) error
Alter(ctx context.Context, request *AlterDatabaseRoleRequest) error
}
// CreateDatabaseRoleOptions is based on https://docs.snowflake.com/en/sql-reference/sql/create-database-role.
type CreateDatabaseRoleOptions struct {
create bool `ddl:"static" sql:"CREATE"`
OrReplace *bool `ddl:"keyword" sql:"OR REPLACE"`
databaseRole bool `ddl:"static" sql:"DATABASE ROLE"`
IfNotExists *bool `ddl:"keyword" sql:"IF NOT EXISTS"`
name DatabaseObjectIdentifier `ddl:"identifier"`
Comment *string `ddl:"parameter,single_quotes" sql:"COMMENT"`
}
// AlterDatabaseRoleOptions is based on https://docs.snowflake.com/en/sql-reference/sql/alter-database-role.
type AlterDatabaseRoleOptions struct {
alter bool `ddl:"static" sql:"ALTER"`
databaseRole bool `ddl:"static" sql:"DATABASE ROLE"`
IfExists *bool `ddl:"keyword" sql:"IF EXISTS"`
name DatabaseObjectIdentifier `ddl:"identifier"`
Rename *DatabaseRoleRename `ddl:"list,no_parentheses" sql:"RENAME TO"`
Set *DatabaseRoleSet `ddl:"list,no_parentheses" sql:"SET"`
Unset *DatabaseRoleUnset `ddl:"list,no_parentheses" sql:"UNSET"`
}
type DatabaseRoleRename struct {
Name DatabaseObjectIdentifier `ddl:"identifier"`
}
type DatabaseRoleSet struct {
Comment string `ddl:"parameter,single_quotes" sql:"COMMENT"`
NestedThirdLevel *NestedThirdLevel `ddl:"list,no_parentheses" sql:"NESTED"`
}
type NestedThirdLevel struct {
Field DatabaseObjectIdentifier `ddl:"identifier"`
}
type DatabaseRoleUnset struct {
Comment *bool `ddl:"keyword" sql:"COMMENT"`
}