Generate enum types for sqlbuilder.
This commit is contained in:
parent
7c98fb508c
commit
ca5a30983e
6 changed files with 64 additions and 17 deletions
21
sqlbuilder/enum_value.go
Normal file
21
sqlbuilder/enum_value.go
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
package sqlbuilder
|
||||
|
||||
type enumValue struct {
|
||||
expressionInterfaceImpl
|
||||
stringInterfaceImpl
|
||||
name string
|
||||
}
|
||||
|
||||
func NewEnumValue(name string) StringExpression {
|
||||
enumValue := &enumValue{name: name}
|
||||
|
||||
enumValue.expressionInterfaceImpl.parent = enumValue
|
||||
enumValue.stringInterfaceImpl.parent = enumValue
|
||||
|
||||
return enumValue
|
||||
}
|
||||
|
||||
func (e enumValue) serialize(statement statementType, out *queryData, options ...serializeOption) error {
|
||||
out.insertConstantArgument(e.name)
|
||||
return nil
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue