mydb/function.go
2023-09-18 15:15:42 +08:00

26 lines
495 B
Go

package mydb
import "git.hexq.cn/tiglog/mydb/internal/adapter"
// FuncExpr represents functions.
type FuncExpr = adapter.FuncExpr
// Func returns a database function expression.
//
// Examples:
//
// // MOD(29, 9)
// db.Func("MOD", 29, 9)
//
// // CONCAT("foo", "bar")
// db.Func("CONCAT", "foo", "bar")
//
// // NOW()
// db.Func("NOW")
//
// // RTRIM("Hello ")
// db.Func("RTRIM", "Hello ")
func Func(name string, args ...interface{}) *FuncExpr {
return adapter.NewFuncExpr(name, args)
}