Merge pull request #55 from campsite/develop
Add support for custom functions.
This commit is contained in:
commit
667d534a65
4 changed files with 15 additions and 0 deletions
|
|
@ -801,3 +801,8 @@ func newTimestampzFunc(name string, expressions ...Expression) *timestampzFunc {
|
|||
|
||||
return timestampzFunc
|
||||
}
|
||||
|
||||
// Func can be used to call an custom or as of yet unsupported function in the database.
|
||||
func Func(name string, expressions ...Expression) Expression {
|
||||
return newFunc(name, expressions, nil)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -176,3 +176,7 @@ func TestTO_ASCII(t *testing.T) {
|
|||
assertClauseSerialize(t, TO_ASCII(String("Karel")), `TO_ASCII($1)`, "Karel")
|
||||
assertClauseSerialize(t, TO_ASCII(String("Karel")), `TO_ASCII($1)`, "Karel")
|
||||
}
|
||||
|
||||
func TestFunc(t *testing.T) {
|
||||
assertClauseSerialize(t, Func("FOO", String("test"), NULL, MAX(Int(1))), "FOO($1, NULL, MAX($2))", "test", int64(1))
|
||||
}
|
||||
|
|
|
|||
|
|
@ -74,5 +74,8 @@ var TimestampExp = jet.TimestampExp
|
|||
// For example: Raw("current_database()")
|
||||
var Raw = jet.Raw
|
||||
|
||||
// Func can be used to call an custom or as of yet unsupported function in the database.
|
||||
var Func = jet.Func
|
||||
|
||||
// NewEnumValue creates new named enum value
|
||||
var NewEnumValue = jet.NewEnumValue
|
||||
|
|
|
|||
|
|
@ -85,5 +85,8 @@ var TimestampzExp = jet.TimestampzExp
|
|||
// For example: Raw("current_database()")
|
||||
var Raw = jet.Raw
|
||||
|
||||
// Func can be used to call an custom or as of yet unsupported function in the database.
|
||||
var Func = jet.Func
|
||||
|
||||
// NewEnumValue creates new named enum value
|
||||
var NewEnumValue = jet.NewEnumValue
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue