Documentation
¶
Index ¶
- Constants
- Variables
- func NewArrayLength(array sql.Expression) sql.Expression
- func NewCeil(num sql.Expression) sql.Expression
- func NewCharLength(e sql.Expression) sql.Expression
- func NewCoalesce(args ...sql.Expression) (sql.Expression, error)
- func NewConcat(args ...sql.Expression) (sql.Expression, error)
- func NewConcatWithSeparator(args ...sql.Expression) (sql.Expression, error)
- func NewConnectionID() sql.Expression
- func NewDatabase(c *sql.Catalog) func() sql.Expression
- func NewDate(date sql.Expression) sql.Expression
- func NewDateAdd(args ...sql.Expression) (sql.Expression, error)
- func NewDateSub(args ...sql.Expression) (sql.Expression, error)
- func NewDatetime(args ...sql.Expression) (sql.Expression, error)
- func NewDay(date sql.Expression) sql.Expression
- func NewDayOfWeek(date sql.Expression) sql.Expression
- func NewDayOfYear(date sql.Expression) sql.Expression
- func NewExplode(child sql.Expression) sql.Expression
- func NewFloor(num sql.Expression) sql.Expression
- func NewFromBase64(e sql.Expression) sql.Expression
- func NewGenerate(child sql.Expression) sql.Expression
- func NewGreatest(args ...sql.Expression) (sql.Expression, error)
- func NewHour(date sql.Expression) sql.Expression
- func NewIf(expr, ifTrue, ifFalse sql.Expression) sql.Expression
- func NewIfNull(ex, value sql.Expression) sql.Expression
- func NewInstr(str, substr sql.Expression) sql.Expression
- func NewIsBinary(e sql.Expression) sql.Expression
- func NewJSONExtract(args ...sql.Expression) (sql.Expression, error)
- func NewJSONUnquote(json sql.Expression) sql.Expression
- func NewLeast(args ...sql.Expression) (sql.Expression, error)
- func NewLeft(str, len sql.Expression) sql.Expression
- func NewLength(e sql.Expression) sql.Expression
- func NewLog(args ...sql.Expression) (sql.Expression, error)
- func NewLogBase(base float64, e sql.Expression) sql.Expression
- func NewLogBaseFunc(base float64) func(e sql.Expression) sql.Expression
- func NewLower(e sql.Expression) sql.Expression
- func NewMinute(date sql.Expression) sql.Expression
- func NewMonth(date sql.Expression) sql.Expression
- func NewNow() sql.Expression
- func NewNullIf(ex1, ex2 sql.Expression) sql.Expression
- func NewPad(pType padType, args ...sql.Expression) (sql.Expression, error)
- func NewPadFunc(pType padType) func(e ...sql.Expression) (sql.Expression, error)
- func NewPower(e1, e2 sql.Expression) sql.Expression
- func NewRand(exprs ...sql.Expression) (sql.Expression, error)
- func NewRegexpMatches(args ...sql.Expression) (sql.Expression, error)
- func NewRepeat(str sql.Expression, count sql.Expression) sql.Expression
- func NewReplace(str sql.Expression, fromStr sql.Expression, toStr sql.Expression) sql.Expression
- func NewReverse(e sql.Expression) sql.Expression
- func NewRound(args ...sql.Expression) (sql.Expression, error)
- func NewSecond(date sql.Expression) sql.Expression
- func NewSleep(e sql.Expression) sql.Expression
- func NewSoundex(e sql.Expression) sql.Expression
- func NewSplit(str, delimiter sql.Expression) sql.Expression
- func NewSqrt(e sql.Expression) sql.Expression
- func NewSubstring(args ...sql.Expression) (sql.Expression, error)
- func NewSubstringIndex(str, delim, count sql.Expression) sql.Expression
- func NewTimestamp(args ...sql.Expression) (sql.Expression, error)
- func NewToBase64(e sql.Expression) sql.Expression
- func NewTrim(tType trimType, str sql.Expression) sql.Expression
- func NewTrimFunc(tType trimType) func(e sql.Expression) sql.Expression
- func NewUnaryMathFunc(name string, logic UnaryMathFuncLogic) func(e sql.Expression) sql.Expression
- func NewUnixTimestamp(args ...sql.Expression) (sql.Expression, error)
- func NewUpper(e sql.Expression) sql.Expression
- func NewUser() sql.Expression
- func NewVersion(versionPostfix string) func(...sql.Expression) (sql.Expression, error)
- func NewWeekday(date sql.Expression) sql.Expression
- func NewYear(date sql.Expression) sql.Expression
- func NewYearWeek(args ...sql.Expression) (sql.Expression, error)
- type ACosFuncLogic
- type ASinFuncLogic
- type ATanFuncLogic
- type AbsFuncLogic
- type ArrayLength
- type Ceil
- type Coalesce
- func (c *Coalesce) Children() []sql.Expression
- func (c *Coalesce) Eval(ctx *sql.Context, row sql.Row) (interface{}, error)
- func (c *Coalesce) IsNullable() bool
- func (c *Coalesce) Resolved() bool
- func (c *Coalesce) String() string
- func (c *Coalesce) Type() sql.Type
- func (*Coalesce) WithChildren(children ...sql.Expression) (sql.Expression, error)
- type Concat
- func (f *Concat) Children() []sql.Expression
- func (f *Concat) Eval(ctx *sql.Context, row sql.Row) (interface{}, error)
- func (f *Concat) IsNullable() bool
- func (f *Concat) Resolved() bool
- func (f *Concat) String() string
- func (f *Concat) Type() sql.Type
- func (*Concat) WithChildren(children ...sql.Expression) (sql.Expression, error)
- type ConcatWithSeparator
- func (f *ConcatWithSeparator) Children() []sql.Expression
- func (f *ConcatWithSeparator) Eval(ctx *sql.Context, row sql.Row) (interface{}, error)
- func (f *ConcatWithSeparator) IsNullable() bool
- func (f *ConcatWithSeparator) Resolved() bool
- func (f *ConcatWithSeparator) String() string
- func (f *ConcatWithSeparator) Type() sql.Type
- func (*ConcatWithSeparator) WithChildren(children ...sql.Expression) (sql.Expression, error)
- type ConnectionID
- func (ConnectionID) Children() []sql.Expression
- func (ConnectionID) Eval(ctx *sql.Context, _ sql.Row) (interface{}, error)
- func (ConnectionID) IsNullable() bool
- func (ConnectionID) Resolved() bool
- func (ConnectionID) String() string
- func (ConnectionID) Type() sql.Type
- func (c ConnectionID) WithChildren(children ...sql.Expression) (sql.Expression, error)
- type CosFuncLogic
- type CotFuncLogic
- type CountType
- type Database
- func (db *Database) Children() []sql.Expression
- func (db *Database) Eval(ctx *sql.Context, row sql.Row) (interface{}, error)
- func (db *Database) IsNullable() bool
- func (db *Database) Resolved() bool
- func (*Database) String() string
- func (db *Database) Type() sql.Type
- func (d *Database) WithChildren(children ...sql.Expression) (sql.Expression, error)
- type Date
- type DateAdd
- func (d *DateAdd) Children() []sql.Expression
- func (d *DateAdd) Eval(ctx *sql.Context, row sql.Row) (interface{}, error)
- func (d *DateAdd) IsNullable() bool
- func (d *DateAdd) Resolved() bool
- func (d *DateAdd) String() string
- func (d *DateAdd) Type() sql.Type
- func (d *DateAdd) WithChildren(children ...sql.Expression) (sql.Expression, error)
- type DateSub
- func (d *DateSub) Children() []sql.Expression
- func (d *DateSub) Eval(ctx *sql.Context, row sql.Row) (interface{}, error)
- func (d *DateSub) IsNullable() bool
- func (d *DateSub) Resolved() bool
- func (d *DateSub) String() string
- func (d *DateSub) Type() sql.Type
- func (d *DateSub) WithChildren(children ...sql.Expression) (sql.Expression, error)
- type DatetimeConversion
- func (t *DatetimeConversion) Children() []sql.Expression
- func (t *DatetimeConversion) Eval(ctx *sql.Context, r sql.Row) (interface{}, error)
- func (t *DatetimeConversion) IsNullable() bool
- func (t *DatetimeConversion) Resolved() bool
- func (t *DatetimeConversion) String() string
- func (t *DatetimeConversion) Type() sql.Type
- func (t *DatetimeConversion) WithChildren(children ...sql.Expression) (sql.Expression, error)
- type Day
- type DayOfWeek
- type DayOfYear
- type DegreesFuncLogic
- type Explode
- func (e *Explode) Children() []sql.Expression
- func (e *Explode) Eval(*sql.Context, sql.Row) (interface{}, error)
- func (e *Explode) IsNullable() bool
- func (e *Explode) Resolved() bool
- func (e *Explode) String() string
- func (e *Explode) Type() sql.Type
- func (e *Explode) WithChildren(children ...sql.Expression) (sql.Expression, error)
- type Floor
- type FromBase64
- type Generate
- func (e *Generate) Children() []sql.Expression
- func (e *Generate) Eval(ctx *sql.Context, row sql.Row) (interface{}, error)
- func (e *Generate) IsNullable() bool
- func (e *Generate) Resolved() bool
- func (e *Generate) String() string
- func (e *Generate) Type() sql.Type
- func (e *Generate) WithChildren(children ...sql.Expression) (sql.Expression, error)
- type Greatest
- func (f *Greatest) Children() []sql.Expression
- func (f *Greatest) Eval(ctx *sql.Context, row sql.Row) (interface{}, error)
- func (f *Greatest) IsNullable() bool
- func (f *Greatest) Resolved() bool
- func (f *Greatest) String() string
- func (f *Greatest) Type() sql.Type
- func (f *Greatest) WithChildren(children ...sql.Expression) (sql.Expression, error)
- type Hour
- type If
- func (f *If) Children() []sql.Expression
- func (f *If) Eval(ctx *sql.Context, row sql.Row) (interface{}, error)
- func (f *If) IsNullable() bool
- func (f *If) Resolved() bool
- func (f *If) String() string
- func (f *If) Type() sql.Type
- func (f *If) WithChildren(children ...sql.Expression) (sql.Expression, error)
- type IfNull
- type Instr
- func (i Instr) Children() []sql.Expression
- func (i Instr) Eval(ctx *sql.Context, row sql.Row) (interface{}, error)
- func (i Instr) IsNullable() bool
- func (i Instr) Resolved() bool
- func (i Instr) String() string
- func (Instr) Type() sql.Type
- func (i Instr) WithChildren(children ...sql.Expression) (sql.Expression, error)
- type IsBinary
- type JSONExtract
- func (j *JSONExtract) Children() []sql.Expression
- func (j *JSONExtract) Eval(ctx *sql.Context, row sql.Row) (interface{}, error)
- func (j *JSONExtract) IsNullable() bool
- func (j *JSONExtract) Resolved() bool
- func (j *JSONExtract) String() string
- func (j *JSONExtract) Type() sql.Type
- func (j *JSONExtract) WithChildren(children ...sql.Expression) (sql.Expression, error)
- type JSONUnquote
- type Least
- func (f *Least) Children() []sql.Expression
- func (f *Least) Eval(ctx *sql.Context, row sql.Row) (interface{}, error)
- func (f *Least) IsNullable() bool
- func (f *Least) Resolved() bool
- func (f *Least) String() string
- func (f *Least) Type() sql.Type
- func (f *Least) WithChildren(children ...sql.Expression) (sql.Expression, error)
- type Left
- func (l Left) Children() []sql.Expression
- func (l Left) Eval(ctx *sql.Context, row sql.Row) (interface{}, error)
- func (l Left) IsNullable() bool
- func (l Left) Resolved() bool
- func (l Left) String() string
- func (Left) Type() sql.Type
- func (l Left) WithChildren(children ...sql.Expression) (sql.Expression, error)
- type Length
- type Log
- type LogBase
- type Lower
- type Minute
- type Month
- type Now
- type NullIf
- type Pad
- func (p *Pad) Children() []sql.Expression
- func (p *Pad) Eval(ctx *sql.Context, row sql.Row) (interface{}, error)
- func (p *Pad) IsNullable() bool
- func (p *Pad) Resolved() bool
- func (p *Pad) String() string
- func (p *Pad) Type() sql.Type
- func (p *Pad) WithChildren(children ...sql.Expression) (sql.Expression, error)
- type Power
- type RadiansFuncLogic
- type Rand
- func (r *Rand) Children() []sql.Expression
- func (r *Rand) Eval(ctx *sql.Context, row sql.Row) (interface{}, error)
- func (r *Rand) IsNullable() bool
- func (r *Rand) Resolved() bool
- func (r *Rand) String() string
- func (r *Rand) Type() sql.Type
- func (r *Rand) WithChildren(children ...sql.Expression) (sql.Expression, error)
- type RegexpMatches
- func (r *RegexpMatches) Children() []sql.Expression
- func (r *RegexpMatches) Eval(ctx *sql.Context, row sql.Row) (interface{}, error)
- func (r *RegexpMatches) IsNullable() bool
- func (r *RegexpMatches) Resolved() bool
- func (r *RegexpMatches) String() string
- func (r *RegexpMatches) Type() sql.Type
- func (r *RegexpMatches) WithChildren(children ...sql.Expression) (sql.Expression, error)
- type Repeat
- type Replace
- func (r *Replace) Children() []sql.Expression
- func (r *Replace) Eval(ctx *sql.Context, row sql.Row) (interface{}, error)
- func (r *Replace) IsNullable() bool
- func (r *Replace) Resolved() bool
- func (r *Replace) String() string
- func (r *Replace) Type() sql.Type
- func (r *Replace) WithChildren(children ...sql.Expression) (sql.Expression, error)
- type Reverse
- type Round
- func (r *Round) Children() []sql.Expression
- func (r *Round) Eval(ctx *sql.Context, row sql.Row) (interface{}, error)
- func (r *Round) IsNullable() bool
- func (r *Round) Resolved() bool
- func (r *Round) String() string
- func (r *Round) Type() sql.Type
- func (r *Round) WithChildren(children ...sql.Expression) (sql.Expression, error)
- type Second
- type SinFuncLogic
- type Sleep
- type Soundex
- type Split
- type Sqrt
- type Substring
- func (s *Substring) Children() []sql.Expression
- func (s *Substring) Eval(ctx *sql.Context, row sql.Row) (interface{}, error)
- func (s *Substring) IsNullable() bool
- func (s *Substring) Resolved() bool
- func (s *Substring) String() string
- func (*Substring) Type() sql.Type
- func (*Substring) WithChildren(children ...sql.Expression) (sql.Expression, error)
- type SubstringIndex
- func (s *SubstringIndex) Children() []sql.Expression
- func (s *SubstringIndex) Eval(ctx *sql.Context, row sql.Row) (interface{}, error)
- func (s *SubstringIndex) IsNullable() bool
- func (s *SubstringIndex) Resolved() bool
- func (s *SubstringIndex) String() string
- func (*SubstringIndex) Type() sql.Type
- func (s *SubstringIndex) WithChildren(children ...sql.Expression) (sql.Expression, error)
- type TanFuncLogic
- type TimestampConversion
- func (t *TimestampConversion) Children() []sql.Expression
- func (t *TimestampConversion) Eval(ctx *sql.Context, r sql.Row) (interface{}, error)
- func (t *TimestampConversion) IsNullable() bool
- func (t *TimestampConversion) Resolved() bool
- func (t *TimestampConversion) String() string
- func (t *TimestampConversion) Type() sql.Type
- func (t *TimestampConversion) WithChildren(children ...sql.Expression) (sql.Expression, error)
- type ToBase64
- type Trim
- type UnaryMathFloatFuncLogic
- type UnaryMathFloatFuncWrapper
- func (wr UnaryMathFloatFuncWrapper) EvalDecimal(dec decimal.Decimal) (interface{}, error)
- func (wr UnaryMathFloatFuncWrapper) EvalFloat(n float64) (interface{}, error)
- func (wr UnaryMathFloatFuncWrapper) EvalInt(n int64) (interface{}, error)
- func (wr UnaryMathFloatFuncWrapper) EvalUint(n uint64) (interface{}, error)
- type UnaryMathFunc
- type UnaryMathFuncLogic
- type UnixTimestamp
- func (ut *UnixTimestamp) Children() []sql.Expression
- func (ut *UnixTimestamp) Eval(ctx *sql.Context, row sql.Row) (interface{}, error)
- func (ut *UnixTimestamp) IsNullable() bool
- func (ut *UnixTimestamp) Resolved() bool
- func (ut *UnixTimestamp) String() string
- func (ut *UnixTimestamp) Type() sql.Type
- func (ut *UnixTimestamp) WithChildren(children ...sql.Expression) (sql.Expression, error)
- type Upper
- type User
- type Version
- func (f Version) Children() []sql.Expression
- func (f Version) Eval(ctx *sql.Context, row sql.Row) (interface{}, error)
- func (f Version) IsNullable() bool
- func (f Version) Resolved() bool
- func (f Version) String() string
- func (f Version) Type() sql.Type
- func (f Version) WithChildren(children ...sql.Expression) (sql.Expression, error)
- type Weekday
- type Year
- type YearWeek
- func (d *YearWeek) Children() []sql.Expression
- func (d *YearWeek) Eval(ctx *sql.Context, row sql.Row) (interface{}, error)
- func (d *YearWeek) IsNullable() bool
- func (d *YearWeek) Resolved() bool
- func (d *YearWeek) String() string
- func (d *YearWeek) Type() sql.Type
- func (*YearWeek) WithChildren(children ...sql.Expression) (sql.Expression, error)
Constants ¶
const ( // NumBytes counts the number of bytes in a string or binary content. NumBytes = CountType(false) // NumChars counts the number of characters in a string or binary content. NumChars = CountType(true) )
Variables ¶
var Defaults = []sql.Function{ sql.Function0{Name: "connection_id", Fn: NewConnectionID}, sql.Function0{Name: "user", Fn: NewUser}, sql.Function0{Name: "current_user", Fn: NewUser}, sql.Function0{Name: "now", Fn: NewNow}, sql.Function1{Name: "abs", Fn: NewUnaryMathFunc("abs", AbsFuncLogic{})}, sql.Function1{Name: "acos", Fn: NewUnaryMathFunc("acos", WrapUnaryMathFloatFuncLogic(ACosFuncLogic{}))}, sql.Function1{Name: "array_length", Fn: NewArrayLength}, sql.Function1{Name: "asin", Fn: NewUnaryMathFunc("asin", WrapUnaryMathFloatFuncLogic(ASinFuncLogic{}))}, sql.Function1{Name: "atan", Fn: NewUnaryMathFunc("atan", WrapUnaryMathFloatFuncLogic(TanFuncLogic{}))}, sql.Function1{Name: "avg", Fn: func(e sql.Expression) sql.Expression { return aggregation.NewAvg(e) }}, sql.Function1{Name: "ceil", Fn: NewCeil}, sql.Function1{Name: "ceiling", Fn: NewCeil}, sql.Function1{Name: "char_length", Fn: NewCharLength}, sql.Function1{Name: "character_length", Fn: NewCharLength}, sql.Function1{Name: "count", Fn: func(e sql.Expression) sql.Expression { return aggregation.NewCount(e) }}, sql.Function1{Name: "cos", Fn: NewUnaryMathFunc("cos", WrapUnaryMathFloatFuncLogic(CosFuncLogic{}))}, sql.Function1{Name: "cot", Fn: NewUnaryMathFunc("cot", WrapUnaryMathFloatFuncLogic(CotFuncLogic{}))}, sql.Function1{Name: "date", Fn: NewDate}, sql.Function1{Name: "day", Fn: NewDay}, sql.Function1{Name: "dayofmonth", Fn: NewDay}, sql.Function1{Name: "dayofweek", Fn: NewDayOfWeek}, sql.Function1{Name: "dayofyear", Fn: NewDayOfYear}, sql.Function1{Name: "degrees", Fn: NewUnaryMathFunc("degrees", WrapUnaryMathFloatFuncLogic(DegreesFuncLogic{}))}, sql.Function1{Name: "explode", Fn: NewExplode}, sql.Function1{Name: "first", Fn: func(e sql.Expression) sql.Expression { return aggregation.NewFirst(e) }}, sql.Function1{Name: "floor", Fn: NewFloor}, sql.Function1{Name: "from_base64", Fn: NewFromBase64}, sql.Function1{Name: "hour", Fn: NewHour}, sql.Function1{Name: "is_binary", Fn: NewIsBinary}, sql.Function1{Name: "json_unquote", Fn: NewJSONUnquote}, sql.Function1{Name: "last", Fn: func(e sql.Expression) sql.Expression { return aggregation.NewLast(e) }}, sql.Function1{Name: "length", Fn: NewLength}, sql.Function1{Name: "ln", Fn: NewLogBaseFunc(float64(math.E))}, sql.Function1{Name: "log10", Fn: NewLogBaseFunc(float64(10))}, sql.Function1{Name: "log2", Fn: NewLogBaseFunc(float64(2))}, sql.Function1{Name: "lower", Fn: NewLower}, sql.Function1{Name: "ltrim", Fn: NewTrimFunc(lTrimType)}, sql.Function1{Name: "max", Fn: func(e sql.Expression) sql.Expression { return aggregation.NewMax(e) }}, sql.Function1{Name: "min", Fn: func(e sql.Expression) sql.Expression { return aggregation.NewMin(e) }}, sql.Function1{Name: "minute", Fn: NewMinute}, sql.Function1{Name: "month", Fn: NewMonth}, sql.Function1{Name: "radians", Fn: NewUnaryMathFunc("radians", WrapUnaryMathFloatFuncLogic(RadiansFuncLogic{}))}, sql.Function1{Name: "reverse", Fn: NewReverse}, sql.Function1{Name: "rtrim", Fn: NewTrimFunc(rTrimType)}, sql.Function1{Name: "second", Fn: NewSecond}, sql.Function1{Name: "sin", Fn: NewUnaryMathFunc("sin", WrapUnaryMathFloatFuncLogic(SinFuncLogic{}))}, sql.Function1{Name: "sleep", Fn: NewSleep}, sql.Function1{Name: "soundex", Fn: NewSoundex}, sql.Function1{Name: "sqrt", Fn: NewSqrt}, sql.Function1{Name: "sum", Fn: func(e sql.Expression) sql.Expression { return aggregation.NewSum(e) }}, sql.Function1{Name: "tan", Fn: NewUnaryMathFunc("tan", WrapUnaryMathFloatFuncLogic(TanFuncLogic{}))}, sql.Function1{Name: "to_base64", Fn: NewToBase64}, sql.Function1{Name: "trim", Fn: NewTrimFunc(bTrimType)}, sql.Function1{Name: "upper", Fn: NewUpper}, sql.Function1{Name: "weekday", Fn: NewWeekday}, sql.Function1{Name: "year", Fn: NewYear}, sql.Function3{Name: "if", Fn: NewIf}, sql.Function2{Name: "ifnull", Fn: NewIfNull}, sql.Function2{Name: "nullif", Fn: NewNullIf}, sql.Function2{Name: "pow", Fn: NewPower}, sql.Function2{Name: "power", Fn: NewPower}, sql.Function2{Name: "repeat", Fn: NewRepeat}, sql.Function2{Name: "split", Fn: NewSplit}, sql.Function3{Name: "replace", Fn: NewReplace}, sql.Function3{Name: "substring_index", Fn: NewSubstringIndex}, sql.FunctionN{Name: "coalesce", Fn: NewCoalesce}, sql.FunctionN{Name: "concat", Fn: NewConcat}, sql.FunctionN{Name: "concat_ws", Fn: NewConcatWithSeparator}, sql.FunctionN{Name: "date_add", Fn: NewDateAdd}, sql.FunctionN{Name: "date_sub", Fn: NewDateSub}, sql.FunctionN{Name: "greatest", Fn: NewGreatest}, sql.FunctionN{Name: "json_extract", Fn: NewJSONExtract}, sql.Function2{Name: "instr", Fn: NewInstr}, sql.FunctionN{Name: "least", Fn: NewLeast}, sql.Function2{Name: "left", Fn: NewLeft}, sql.FunctionN{Name: "log", Fn: NewLog}, sql.FunctionN{Name: "lpad", Fn: NewPadFunc(lPadType)}, sql.FunctionN{Name: "mid", Fn: NewSubstring}, sql.FunctionN{Name: "rand", Fn: NewRand}, sql.FunctionN{Name: "regexp_matches", Fn: NewRegexpMatches}, sql.FunctionN{Name: "round", Fn: NewRound}, sql.FunctionN{Name: "rpad", Fn: NewPadFunc(rPadType)}, sql.FunctionN{Name: "substr", Fn: NewSubstring}, sql.FunctionN{Name: "substring", Fn: NewSubstring}, sql.FunctionN{Name: "unix_timestamp", Fn: NewUnixTimestamp}, sql.FunctionN{Name: "timestamp", Fn: NewTimestamp}, sql.FunctionN{Name: "datetime", Fn: NewDatetime}, sql.FunctionN{Name: "yearweek", Fn: NewYearWeek}, }
Defaults is the function map with all the default functions.
var ErrConcatArrayWithOthers = errors.NewKind("can't concat a string array with any other elements")
ErrConcatArrayWithOthers is returned when there are more than 1 argument in concat and any of them is an array.
var ErrDivisionByZero = errors.NewKind("division by zero")
var ErrInvalidArgumentForLogarithm = errors.NewKind("invalid argument value for logarithm: %v")
ErrInvalidArgumentForLogarithm is returned when an invalid argument value is passed to a logarithm function
var ErrNegativeRepeatCount = errors.NewKind("negative Repeat count: %v")
var ErrUintOverflow = errors.NewKind(
"Unsigned integer too big to fit on signed integer")
var ErrUnsupportedType = errors.NewKind("unsupported type for greatest/least argument: %T")
ErrUnsupportedType is returned when an argument to Greatest or Latest is not numeric or string
var IntRegex, _ = regexp.Compile("^-?[1-9][0-9]*$")
IntRegex matches ints
var UintRegex, _ = regexp.Compile("^[1-9][0-9]*$")
UintRegex matches unsigned ints
Functions ¶
func NewArrayLength ¶
func NewArrayLength(array sql.Expression) sql.Expression
NewArrayLength creates a new ArrayLength UDF.
func NewCeil ¶
func NewCeil(num sql.Expression) sql.Expression
NewCeil creates a new Ceil expression.
func NewCharLength ¶
func NewCharLength(e sql.Expression) sql.Expression
NewCharLength returns a new CHAR_LENGTH function.
func NewCoalesce ¶
func NewCoalesce(args ...sql.Expression) (sql.Expression, error)
NewCoalesce creates a new Coalesce sql.Expression.
func NewConcat ¶
func NewConcat(args ...sql.Expression) (sql.Expression, error)
NewConcat creates a new Concat UDF.
func NewConcatWithSeparator ¶
func NewConcatWithSeparator(args ...sql.Expression) (sql.Expression, error)
NewConcatWithSeparator creates a new NewConcatWithSeparator UDF.
func NewConnectionID ¶
func NewConnectionID() sql.Expression
NewConnectionID creates a new ConnectionID UDF node.
func NewDatabase ¶
func NewDatabase(c *sql.Catalog) func() sql.Expression
NewDatabase returns a new Database function
func NewDateAdd ¶
func NewDateAdd(args ...sql.Expression) (sql.Expression, error)
NewDateAdd creates a new date add function.
func NewDateSub ¶
func NewDateSub(args ...sql.Expression) (sql.Expression, error)
NewDateSub creates a new date add function.
func NewDatetime ¶
func NewDatetime(args ...sql.Expression) (sql.Expression, error)
func NewDayOfWeek ¶
func NewDayOfWeek(date sql.Expression) sql.Expression
NewDayOfWeek creates a new DayOfWeek UDF.
func NewDayOfYear ¶
func NewDayOfYear(date sql.Expression) sql.Expression
NewDayOfYear creates a new DayOfYear UDF.
func NewExplode ¶
func NewExplode(child sql.Expression) sql.Expression
NewExplode creates a new Explode function.
func NewFloor ¶
func NewFloor(num sql.Expression) sql.Expression
NewFloor returns a new Floor expression.
func NewFromBase64 ¶
func NewFromBase64(e sql.Expression) sql.Expression
NewFromBase64 creates a new FromBase64 expression.
func NewGenerate ¶
func NewGenerate(child sql.Expression) sql.Expression
NewGenerate creates a new Generate function.
func NewGreatest ¶
func NewGreatest(args ...sql.Expression) (sql.Expression, error)
NewGreatest creates a new Greatest UDF
func NewIf ¶
func NewIf(expr, ifTrue, ifFalse sql.Expression) sql.Expression
NewIf returns a new IF UDF
func NewIfNull ¶
func NewIfNull(ex, value sql.Expression) sql.Expression
NewIfNull returns a new IFNULL UDF
func NewInstr ¶
func NewInstr(str, substr sql.Expression) sql.Expression
NewInstr creates a new instr UDF.
func NewIsBinary ¶
func NewIsBinary(e sql.Expression) sql.Expression
NewIsBinary creates a new IsBinary expression.
func NewJSONExtract ¶
func NewJSONExtract(args ...sql.Expression) (sql.Expression, error)
NewJSONExtract creates a new JSONExtract UDF.
func NewJSONUnquote ¶
func NewJSONUnquote(json sql.Expression) sql.Expression
NewJSONUnquote creates a new JSONUnquote UDF.
func NewLeast ¶
func NewLeast(args ...sql.Expression) (sql.Expression, error)
NewLeast creates a new Least UDF
func NewLeft ¶
func NewLeft(str, len sql.Expression) sql.Expression
NewLeft creates a new LEFT function.
func NewLength ¶
func NewLength(e sql.Expression) sql.Expression
NewLength returns a new LENGTH function.
func NewLog ¶
func NewLog(args ...sql.Expression) (sql.Expression, error)
NewLog creates a new Log expression.
func NewLogBase ¶
func NewLogBase(base float64, e sql.Expression) sql.Expression
NewLogBase creates a new LogBase expression.
func NewLogBaseFunc ¶
func NewLogBaseFunc(base float64) func(e sql.Expression) sql.Expression
NewLogBaseFunc returns LogBase creator function with a specific base.
func NewLower ¶
func NewLower(e sql.Expression) sql.Expression
NewLower creates a new Lower expression.
func NewMinute ¶
func NewMinute(date sql.Expression) sql.Expression
NewMinute creates a new Minute UDF.
func NewNullIf ¶
func NewNullIf(ex1, ex2 sql.Expression) sql.Expression
NewNullIf returns a new NULLIF UDF
func NewPad ¶
func NewPad(pType padType, args ...sql.Expression) (sql.Expression, error)
NewPad creates a new Pad expression.
func NewPadFunc ¶
func NewPadFunc(pType padType) func(e ...sql.Expression) (sql.Expression, error)
NewPadFunc returns a Pad creator function with a specific padType.
func NewPower ¶
func NewPower(e1, e2 sql.Expression) sql.Expression
NewPower creates a new Power expression.
func NewRand ¶
func NewRand(exprs ...sql.Expression) (sql.Expression, error)
NewRand creates a new Rand expression.
func NewRegexpMatches ¶
func NewRegexpMatches(args ...sql.Expression) (sql.Expression, error)
NewRegexpMatches creates a new RegexpMatches expression.
func NewRepeat ¶
func NewRepeat(str sql.Expression, count sql.Expression) sql.Expression
NewRepeat creates a new Repeat expression.
func NewReplace ¶
func NewReplace(str sql.Expression, fromStr sql.Expression, toStr sql.Expression) sql.Expression
NewReplace creates a new Replace expression.
func NewReverse ¶
func NewReverse(e sql.Expression) sql.Expression
NewReverse creates a new Reverse expression.
func NewRound ¶
func NewRound(args ...sql.Expression) (sql.Expression, error)
NewRound returns a new Round expression.
func NewSecond ¶
func NewSecond(date sql.Expression) sql.Expression
NewSecond creates a new Second UDF.
func NewSleep ¶
func NewSleep(e sql.Expression) sql.Expression
NewSleep creates a new Sleep expression.
func NewSoundex ¶
func NewSoundex(e sql.Expression) sql.Expression
NewSoundex creates a new Soundex expression.
func NewSplit ¶
func NewSplit(str, delimiter sql.Expression) sql.Expression
NewSplit creates a new Split UDF.
func NewSubstring ¶
func NewSubstring(args ...sql.Expression) (sql.Expression, error)
NewSubstring creates a new substring UDF.
func NewSubstringIndex ¶
func NewSubstringIndex(str, delim, count sql.Expression) sql.Expression
NewSubstringIndex creates a new SubstringIndex UDF.
func NewTimestamp ¶
func NewTimestamp(args ...sql.Expression) (sql.Expression, error)
func NewToBase64 ¶
func NewToBase64(e sql.Expression) sql.Expression
NewToBase64 creates a new ToBase64 expression.
func NewTrim ¶
func NewTrim(tType trimType, str sql.Expression) sql.Expression
NewTrim creates a new Trim expression.
func NewTrimFunc ¶
func NewTrimFunc(tType trimType) func(e sql.Expression) sql.Expression
NewTrimFunc returns a Trim creator function with a specific trimType.
func NewUnaryMathFunc ¶
func NewUnaryMathFunc(name string, logic UnaryMathFuncLogic) func(e sql.Expression) sql.Expression
NewUnaryMathFunc returns a function which is called to create a sql.Expression representing the function and its argemunts
func NewUnixTimestamp ¶
func NewUnixTimestamp(args ...sql.Expression) (sql.Expression, error)
func NewUpper ¶
func NewUpper(e sql.Expression) sql.Expression
NewUpper creates a new Lower expression.
func NewVersion ¶
func NewVersion(versionPostfix string) func(...sql.Expression) (sql.Expression, error)
NewVersion creates a new Version UDF.
func NewWeekday ¶
func NewWeekday(date sql.Expression) sql.Expression
NewWeekday creates a new Weekday UDF.
func NewYearWeek ¶
func NewYearWeek(args ...sql.Expression) (sql.Expression, error)
NewYearWeek creates a new YearWeek UDF
Types ¶
type ACosFuncLogic ¶
type ACosFuncLogic struct{}
ACosFuncLogic is a UnaryMathFloatFuncWrapper implementation which returns the acos of a value
func (ACosFuncLogic) EvalFloat ¶
func (fl ACosFuncLogic) EvalFloat(n float64) (interface{}, error)
EvalFloat handles the case where the number argument passed is a float
type ASinFuncLogic ¶
type ASinFuncLogic struct{}
ASinFuncLogic is a UnaryMathFloatFuncWrapper implementation which returns the asin of a value
func (ASinFuncLogic) EvalFloat ¶
func (fl ASinFuncLogic) EvalFloat(n float64) (interface{}, error)
EvalFloat handles the case where the number argument passed is a float
type ATanFuncLogic ¶
type ATanFuncLogic struct{}
ATanFuncLogic is a UnaryMathFloatFuncWrapper implementation which returns the atan of a value
func (ATanFuncLogic) EvalFloat ¶
func (fl ATanFuncLogic) EvalFloat(n float64) (interface{}, error)
EvalFloat handles the case where the number argument passed is a float
type AbsFuncLogic ¶
type AbsFuncLogic struct{}
AbsFuncLogic is a UnaryMathFuncLogic implementation that returns the absolute value of a number
func (AbsFuncLogic) EvalDecimal ¶
func (fl AbsFuncLogic) EvalDecimal(dec decimal.Decimal) (interface{}, error)
EvalDecimal handles the case where the number argument passed is a decimal
func (AbsFuncLogic) EvalFloat ¶
func (fl AbsFuncLogic) EvalFloat(n float64) (interface{}, error)
EvalFloat handles the case where the number argument passed is a float
func (AbsFuncLogic) EvalInt ¶
func (fl AbsFuncLogic) EvalInt(n int64) (interface{}, error)
EvalInt handles the case where the number argument passed is an int
func (AbsFuncLogic) EvalUint ¶
func (fl AbsFuncLogic) EvalUint(n uint64) (interface{}, error)
EvalUint handles the case where the number argument passed is a uint
type ArrayLength ¶
type ArrayLength struct {
expression.UnaryExpression
}
ArrayLength returns the length of an array.
func (*ArrayLength) String ¶
func (f *ArrayLength) String() string
func (*ArrayLength) Type ¶
func (*ArrayLength) Type() sql.Type
Type implements the Expression interface.
func (*ArrayLength) WithChildren ¶
func (f *ArrayLength) WithChildren(children ...sql.Expression) (sql.Expression, error)
WithChildren implements the Expression interface.
type Ceil ¶
type Ceil struct {
expression.UnaryExpression
}
Ceil returns the smallest integer value not less than X.
func (*Ceil) WithChildren ¶
func (c *Ceil) WithChildren(children ...sql.Expression) (sql.Expression, error)
WithChildren implements the Expression interface.
type Coalesce ¶
type Coalesce struct {
// contains filtered or unexported fields
}
Coalesce returns the first non-NULL value in the list, or NULL if there are no non-NULL values.
func (*Coalesce) Children ¶
func (c *Coalesce) Children() []sql.Expression
Children implements the sql.Expression interface.
func (*Coalesce) Eval ¶
Eval implements the sql.Expression interface. The function evaluates the first non-nil argument. If the value is nil, then we keep going, otherwise we return the first non-nil value.
func (*Coalesce) IsNullable ¶
IsNullable implements the sql.Expression interface. Returns true if all arguments are nil or of the first non-nil argument is nullable, otherwise false.
func (*Coalesce) Resolved ¶
Resolved implements the sql.Expression interface. The function checks if first non-nil argument is resolved.
func (*Coalesce) Type ¶
Type implements the sql.Expression interface. The return type of Type() is the aggregated type of the argument types.
func (*Coalesce) WithChildren ¶
func (*Coalesce) WithChildren(children ...sql.Expression) (sql.Expression, error)
WithChildren implements the Expression interface.
type Concat ¶
type Concat struct {
// contains filtered or unexported fields
}
Concat joins several strings together.
func (*Concat) Children ¶
func (f *Concat) Children() []sql.Expression
Children implements the Expression interface.
func (*Concat) IsNullable ¶
IsNullable implements the Expression interface.
func (*Concat) WithChildren ¶
func (*Concat) WithChildren(children ...sql.Expression) (sql.Expression, error)
WithChildren implements the Expression interface.
type ConcatWithSeparator ¶
type ConcatWithSeparator struct {
// contains filtered or unexported fields
}
ConcatWithSeparator joins several strings together. The first argument is the separator for the rest of the arguments. The separator is added between the strings to be concatenated. The separator can be a string, as can the rest of the arguments. If the separator is NULL, the result is NULL.
func (*ConcatWithSeparator) Children ¶
func (f *ConcatWithSeparator) Children() []sql.Expression
Children implements the Expression interface.
func (*ConcatWithSeparator) IsNullable ¶
func (f *ConcatWithSeparator) IsNullable() bool
IsNullable implements the Expression interface.
func (*ConcatWithSeparator) Resolved ¶
func (f *ConcatWithSeparator) Resolved() bool
Resolved implements the Expression interface.
func (*ConcatWithSeparator) String ¶
func (f *ConcatWithSeparator) String() string
func (*ConcatWithSeparator) Type ¶
func (f *ConcatWithSeparator) Type() sql.Type
Type implements the Expression interface.
func (*ConcatWithSeparator) WithChildren ¶
func (*ConcatWithSeparator) WithChildren(children ...sql.Expression) (sql.Expression, error)
WithChildren implements the Expression interface.
type ConnectionID ¶
type ConnectionID struct{}
ConnectionID returns the current connection id.
func (ConnectionID) Children ¶
func (ConnectionID) Children() []sql.Expression
Children implements the sql.Expression interface.
func (ConnectionID) IsNullable ¶
func (ConnectionID) IsNullable() bool
IsNullable implements the sql.Expression interface.
func (ConnectionID) Resolved ¶
func (ConnectionID) Resolved() bool
Resolved implements the sql.Expression interface.
func (ConnectionID) String ¶
func (ConnectionID) String() string
String implements the fmt.Stringer interface.
func (ConnectionID) Type ¶
func (ConnectionID) Type() sql.Type
Type implements the sql.Expression interface.
func (ConnectionID) WithChildren ¶
func (c ConnectionID) WithChildren(children ...sql.Expression) (sql.Expression, error)
WithChildren implements the Expression interface.
type CosFuncLogic ¶
type CosFuncLogic struct{}
CosFuncLogic is a UnaryMathFloatFuncWrapper implementation which returns the cos of a value
func (CosFuncLogic) EvalFloat ¶
func (fl CosFuncLogic) EvalFloat(n float64) (interface{}, error)
EvalFloat handles the case where the number argument passed is a float
type CotFuncLogic ¶
type CotFuncLogic struct{}
CotFuncLogic is a UnaryMathFloatFuncWrapper implementation which returns the cot of a value
func (CotFuncLogic) EvalFloat ¶
func (fl CotFuncLogic) EvalFloat(n float64) (interface{}, error)
EvalFloat handles the case where the number argument passed is a float
type Database ¶
type Database struct {
// contains filtered or unexported fields
}
Database stands for DATABASE() function
func (*Database) Children ¶
func (db *Database) Children() []sql.Expression
Children implements the sql.Expression interface.
func (*Database) IsNullable ¶
IsNullable implements the sql.Expression interface. The function returns always true
func (*Database) WithChildren ¶
func (d *Database) WithChildren(children ...sql.Expression) (sql.Expression, error)
WithChildren implements the Expression interface.
type Date ¶
type Date struct {
expression.UnaryExpression
}
Date a function takes the DATE part out from a datetime expression.
func (*Date) WithChildren ¶
func (d *Date) WithChildren(children ...sql.Expression) (sql.Expression, error)
WithChildren implements the Expression interface.
type DateAdd ¶
type DateAdd struct { Date sql.Expression Interval *expression.Interval }
DateAdd adds an interval to a date.
func (*DateAdd) Children ¶
func (d *DateAdd) Children() []sql.Expression
Children implements the sql.Expression interface.
func (*DateAdd) IsNullable ¶
IsNullable implements the sql.Expression interface.
func (*DateAdd) WithChildren ¶
func (d *DateAdd) WithChildren(children ...sql.Expression) (sql.Expression, error)
WithChildren implements the Expression interface.
type DateSub ¶
type DateSub struct { Date sql.Expression Interval *expression.Interval }
DateSub subtracts an interval from a date.
func (*DateSub) Children ¶
func (d *DateSub) Children() []sql.Expression
Children implements the sql.Expression interface.
func (*DateSub) IsNullable ¶
IsNullable implements the sql.Expression interface.
func (*DateSub) WithChildren ¶
func (d *DateSub) WithChildren(children ...sql.Expression) (sql.Expression, error)
WithChildren implements the Expression interface.
type DatetimeConversion ¶
type DatetimeConversion struct { Date sql.Expression // contains filtered or unexported fields }
DatetimeConversion is a shorthand function for CONVERT(expr, DATETIME)
func (*DatetimeConversion) Children ¶
func (t *DatetimeConversion) Children() []sql.Expression
func (*DatetimeConversion) IsNullable ¶
func (t *DatetimeConversion) IsNullable() bool
func (*DatetimeConversion) Resolved ¶
func (t *DatetimeConversion) Resolved() bool
func (*DatetimeConversion) String ¶
func (t *DatetimeConversion) String() string
func (*DatetimeConversion) Type ¶
func (t *DatetimeConversion) Type() sql.Type
func (*DatetimeConversion) WithChildren ¶
func (t *DatetimeConversion) WithChildren(children ...sql.Expression) (sql.Expression, error)
type Day ¶
type Day struct {
expression.UnaryExpression
}
Day is a function that returns the day of a date.
func (*Day) WithChildren ¶
func (d *Day) WithChildren(children ...sql.Expression) (sql.Expression, error)
WithChildren implements the Expression interface.
type DayOfWeek ¶
type DayOfWeek struct {
expression.UnaryExpression
}
DayOfWeek is a function that returns the day of the week from a date where 1 = Sunday, ..., 7 = Saturday.
func (*DayOfWeek) WithChildren ¶
func (d *DayOfWeek) WithChildren(children ...sql.Expression) (sql.Expression, error)
WithChildren implements the Expression interface.
type DayOfYear ¶
type DayOfYear struct {
expression.UnaryExpression
}
DayOfYear is a function that returns the day of the year from a date.
func (*DayOfYear) WithChildren ¶
func (d *DayOfYear) WithChildren(children ...sql.Expression) (sql.Expression, error)
WithChildren implements the Expression interface.
type DegreesFuncLogic ¶
type DegreesFuncLogic struct{}
DegreesFuncLogic is a UnaryMathFloatFuncWrapper implementation which converts radians to degrees
func (DegreesFuncLogic) EvalFloat ¶
func (fl DegreesFuncLogic) EvalFloat(n float64) (interface{}, error)
EvalFloat handles the case where the number argument passed is a float
type Explode ¶
type Explode struct {
Child sql.Expression
}
Explode is a function that generates a row for each value of its child. It is a placeholder expression node.
func (*Explode) Children ¶
func (e *Explode) Children() []sql.Expression
Children implements the sql.Expression interface.
func (*Explode) IsNullable ¶
IsNullable implements the sql.Expression interface.
func (*Explode) WithChildren ¶
func (e *Explode) WithChildren(children ...sql.Expression) (sql.Expression, error)
WithChildren implements the Expression interface.
type Floor ¶
type Floor struct {
expression.UnaryExpression
}
Floor returns the biggest integer value not less than X.
func (*Floor) WithChildren ¶
func (f *Floor) WithChildren(children ...sql.Expression) (sql.Expression, error)
WithChildren implements the Expression interface.
type FromBase64 ¶
type FromBase64 struct {
expression.UnaryExpression
}
FromBase64 is a function to decode a Base64-formatted string using the same dialect that MySQL's FROM_BASE64 uses
func (*FromBase64) IsNullable ¶
func (t *FromBase64) IsNullable() bool
IsNullable implements the Expression interface.
func (*FromBase64) String ¶
func (t *FromBase64) String() string
String implements the Stringer interface.
func (*FromBase64) Type ¶
func (t *FromBase64) Type() sql.Type
Type implements the Expression interface.
func (*FromBase64) WithChildren ¶
func (t *FromBase64) WithChildren(children ...sql.Expression) (sql.Expression, error)
WithChildren implements the Expression interface.
type Generate ¶
type Generate struct {
Child sql.Expression
}
Generate is a function that generates a row for each value of its child. This is the non-placeholder counterpart of Explode.
func (*Generate) Children ¶
func (e *Generate) Children() []sql.Expression
Children implements the sql.Expression interface.
func (*Generate) IsNullable ¶
IsNullable implements the sql.Expression interface.
func (*Generate) WithChildren ¶
func (e *Generate) WithChildren(children ...sql.Expression) (sql.Expression, error)
WithChildren implements the Expression interface.
type Greatest ¶
type Greatest struct { Args []sql.Expression // contains filtered or unexported fields }
Greatest returns the argument with the greatest numerical or string value. It allows for numeric (ints anf floats) and string arguments and will return the used type when all arguments are of the same type or floats if there are numerically convertible strings or integers mixed with floats. When ints or floats are mixed with non numerically convertible strings, those are ignored.
func (*Greatest) Children ¶
func (f *Greatest) Children() []sql.Expression
Children implements the Expression interface.
func (*Greatest) IsNullable ¶
IsNullable implements the Expression interface.
func (*Greatest) WithChildren ¶
func (f *Greatest) WithChildren(children ...sql.Expression) (sql.Expression, error)
WithChildren implements the Expression interface.
type Hour ¶
type Hour struct {
expression.UnaryExpression
}
Hour is a function that returns the hour of a date.
func (*Hour) WithChildren ¶
func (h *Hour) WithChildren(children ...sql.Expression) (sql.Expression, error)
WithChildren implements the Expression interface.
type If ¶
type If struct {
// contains filtered or unexported fields
}
If function returns the second value if the first is true, the third value otherwise.
func (*If) Children ¶
func (f *If) Children() []sql.Expression
func (*If) IsNullable ¶
IsNullable implements the Expression interface.
func (*If) WithChildren ¶
func (f *If) WithChildren(children ...sql.Expression) (sql.Expression, error)
WithChildren implements the Expression interface.
type IfNull ¶
type IfNull struct {
expression.BinaryExpression
}
IfNull function returns the specified value IF the expression is NULL, otherwise return the expression.
func (*IfNull) IsNullable ¶
IsNullable implements the Expression interface.
func (*IfNull) WithChildren ¶
func (f *IfNull) WithChildren(children ...sql.Expression) (sql.Expression, error)
WithChildren implements the Expression interface.
type Instr ¶
type Instr struct {
// contains filtered or unexported fields
}
func (Instr) Children ¶
func (i Instr) Children() []sql.Expression
Children implements the Expression interface.
func (Instr) IsNullable ¶
IsNullable implements the Expression interface.
func (Instr) WithChildren ¶
func (i Instr) WithChildren(children ...sql.Expression) (sql.Expression, error)
WithChildren implements the Expression interface.
type IsBinary ¶
type IsBinary struct {
expression.UnaryExpression
}
IsBinary is a function that returns whether a blob is binary or not.
func (*IsBinary) WithChildren ¶
func (ib *IsBinary) WithChildren(children ...sql.Expression) (sql.Expression, error)
WithChildren implements the Expression interface.
type JSONExtract ¶
type JSONExtract struct { JSON sql.Expression Paths []sql.Expression }
JSONExtract extracts data from a json document using json paths.
func (*JSONExtract) Children ¶
func (j *JSONExtract) Children() []sql.Expression
Children implements the sql.Expression interface.
func (*JSONExtract) IsNullable ¶
func (j *JSONExtract) IsNullable() bool
IsNullable implements the sql.Expression interface.
func (*JSONExtract) Resolved ¶
func (j *JSONExtract) Resolved() bool
Resolved implements the sql.Expression interface.
func (*JSONExtract) String ¶
func (j *JSONExtract) String() string
func (*JSONExtract) Type ¶
func (j *JSONExtract) Type() sql.Type
Type implements the sql.Expression interface.
func (*JSONExtract) WithChildren ¶
func (j *JSONExtract) WithChildren(children ...sql.Expression) (sql.Expression, error)
WithChildren implements the Expression interface.
type JSONUnquote ¶
type JSONUnquote struct {
expression.UnaryExpression
}
JSONUnquote unquotes JSON value and returns the result as a utf8mb4 string. Returns NULL if the argument is NULL. An error occurs if the value starts and ends with double quotes but is not a valid JSON string literal.
func (*JSONUnquote) String ¶
func (js *JSONUnquote) String() string
func (*JSONUnquote) Type ¶
func (*JSONUnquote) Type() sql.Type
Type implements the Expression interface.
func (*JSONUnquote) WithChildren ¶
func (js *JSONUnquote) WithChildren(children ...sql.Expression) (sql.Expression, error)
WithChildren implements the Expression interface.
type Least ¶
type Least struct { Args []sql.Expression // contains filtered or unexported fields }
Least returns the argument with the least numerical or string value. It allows for numeric (ints anf floats) and string arguments and will return the used type when all arguments are of the same type or floats if there are numerically convertible strings or integers mixed with floats. When ints or floats are mixed with non numerically convertible strings, those are ignored.
func (*Least) Children ¶
func (f *Least) Children() []sql.Expression
Children implements the Expression interface.
func (*Least) IsNullable ¶
IsNullable implements the Expression interface.
func (*Least) WithChildren ¶
func (f *Least) WithChildren(children ...sql.Expression) (sql.Expression, error)
WithChildren implements the Expression interface.
type Left ¶
type Left struct {
// contains filtered or unexported fields
}
Left is a function that returns the first N characters of a string expression.
func (Left) Children ¶
func (l Left) Children() []sql.Expression
Children implements the Expression interface.
func (Left) IsNullable ¶
IsNullable implements the Expression interface.
func (Left) WithChildren ¶
func (l Left) WithChildren(children ...sql.Expression) (sql.Expression, error)
WithChildren implements the Expression interface.
type Length ¶
type Length struct { expression.UnaryExpression CountType CountType }
Length returns the length of a string or binary content, either in bytes or characters.
func (*Length) WithChildren ¶
func (l *Length) WithChildren(children ...sql.Expression) (sql.Expression, error)
WithChildren implements the Expression interface.
type Log ¶
type Log struct {
expression.BinaryExpression
}
Log is a function that returns the natural logarithm of a value.
func (*Log) Children ¶
func (l *Log) Children() []sql.Expression
Children implements the Expression interface.
func (*Log) IsNullable ¶
IsNullable implements the Expression interface.
func (*Log) WithChildren ¶
func (l *Log) WithChildren(children ...sql.Expression) (sql.Expression, error)
WithChildren implements the Expression interface.
type LogBase ¶
type LogBase struct { expression.UnaryExpression // contains filtered or unexported fields }
LogBase is a function that returns the logarithm of a value with a specific base.
func (*LogBase) IsNullable ¶
IsNullable implements the sql.Expression interface.
func (*LogBase) WithChildren ¶
func (l *LogBase) WithChildren(children ...sql.Expression) (sql.Expression, error)
WithChildren implements the Expression interface.
type Lower ¶
type Lower struct {
expression.UnaryExpression
}
Lower is a function that returns the lowercase of the text provided.
func (*Lower) WithChildren ¶
func (l *Lower) WithChildren(children ...sql.Expression) (sql.Expression, error)
WithChildren implements the Expression interface.
type Minute ¶
type Minute struct {
expression.UnaryExpression
}
Minute is a function that returns the minute of a date.
func (*Minute) WithChildren ¶
func (m *Minute) WithChildren(children ...sql.Expression) (sql.Expression, error)
WithChildren implements the Expression interface.
type Month ¶
type Month struct {
expression.UnaryExpression
}
Month is a function that returns the month of a date.
func (*Month) WithChildren ¶
func (m *Month) WithChildren(children ...sql.Expression) (sql.Expression, error)
WithChildren implements the Expression interface.
type Now ¶
type Now struct {
// contains filtered or unexported fields
}
Now is a function that returns the current time.
func (*Now) Children ¶
func (*Now) Children() []sql.Expression
Children implements the sql.Expression interface.
func (*Now) IsNullable ¶
IsNullable implements the sql.Expression interface.
func (*Now) WithChildren ¶
func (n *Now) WithChildren(children ...sql.Expression) (sql.Expression, error)
WithChildren implements the Expression interface.
type NullIf ¶
type NullIf struct {
expression.BinaryExpression
}
NullIf function compares two expressions and returns NULL if they are equal. Otherwise, the first expression is returned.
func (*NullIf) IsNullable ¶
IsNullable implements the Expression interface.
func (*NullIf) WithChildren ¶
func (f *NullIf) WithChildren(children ...sql.Expression) (sql.Expression, error)
WithChildren implements the Expression interface.
type Pad ¶
type Pad struct {
// contains filtered or unexported fields
}
Pad is a function that pads a string with another string.
func (*Pad) Children ¶
func (p *Pad) Children() []sql.Expression
Children implements the Expression interface.
func (*Pad) IsNullable ¶
IsNullable implements the Expression interface.
func (*Pad) WithChildren ¶
func (p *Pad) WithChildren(children ...sql.Expression) (sql.Expression, error)
WithChildren implements the Expression interface.
type Power ¶
type Power struct {
expression.BinaryExpression
}
Power is a function that returns value of X raised to the power of Y.
func (*Power) IsNullable ¶
IsNullable implements the Expression interface.
func (*Power) WithChildren ¶
func (p *Power) WithChildren(children ...sql.Expression) (sql.Expression, error)
WithChildren implements the Expression interface.
type RadiansFuncLogic ¶
type RadiansFuncLogic struct{}
RadiansFuncLogic is a UnaryMathFloatFuncWrapper implementation which converts degrees to radians
func (RadiansFuncLogic) EvalFloat ¶
func (fl RadiansFuncLogic) EvalFloat(n float64) (interface{}, error)
EvalFloat handles the case where the number argument passed is a float
type Rand ¶
type Rand struct {
Child sql.Expression
}
Rand returns a random float 0 <= x < 1. If it has an argument, that argument will be used to seed the random number generator, effectively turning it into a hash on that value.
func (*Rand) Children ¶
func (r *Rand) Children() []sql.Expression
Children implements the Expression interface
func (*Rand) IsNullable ¶
IsNullable implements the Expression interface
func (*Rand) WithChildren ¶
func (r *Rand) WithChildren(children ...sql.Expression) (sql.Expression, error)
WithChildren implements the Expression interface.
type RegexpMatches ¶
type RegexpMatches struct { Text sql.Expression Pattern sql.Expression Flags sql.Expression // contains filtered or unexported fields }
RegexpMatches returns the matches of a regular expression.
func (*RegexpMatches) Children ¶
func (r *RegexpMatches) Children() []sql.Expression
Children implements the sql.Expression interface.
func (*RegexpMatches) IsNullable ¶
func (r *RegexpMatches) IsNullable() bool
IsNullable implements the sql.Expression interface.
func (*RegexpMatches) Resolved ¶
func (r *RegexpMatches) Resolved() bool
Resolved implements the sql.Expression interface.
func (*RegexpMatches) String ¶
func (r *RegexpMatches) String() string
func (*RegexpMatches) Type ¶
func (r *RegexpMatches) Type() sql.Type
Type implements the sql.Expression interface.
func (*RegexpMatches) WithChildren ¶
func (r *RegexpMatches) WithChildren(children ...sql.Expression) (sql.Expression, error)
WithChildren implements the sql.Expression interface.
type Repeat ¶
type Repeat struct {
expression.BinaryExpression
}
Repeat is a function that returns the string repeated n times.
func (*Repeat) WithChildren ¶
func (r *Repeat) WithChildren(children ...sql.Expression) (sql.Expression, error)
WithChildren implements the Expression interface.
type Replace ¶
type Replace struct {
// contains filtered or unexported fields
}
Replace is a function that returns a string with all occurrences of fromStr replaced by the string toStr
func (*Replace) Children ¶
func (r *Replace) Children() []sql.Expression
Children implements the Expression interface.
func (*Replace) IsNullable ¶
IsNullable implements the Expression interface.
func (*Replace) WithChildren ¶
func (r *Replace) WithChildren(children ...sql.Expression) (sql.Expression, error)
WithChildren implements the Expression interface.
type Reverse ¶
type Reverse struct {
expression.UnaryExpression
}
Reverse is a function that returns the reverse of the text provided.
func (*Reverse) WithChildren ¶
func (r *Reverse) WithChildren(children ...sql.Expression) (sql.Expression, error)
WithChildren implements the Expression interface.
type Round ¶
type Round struct {
expression.BinaryExpression
}
Round returns the number (x) with (d) requested decimal places. If d is negative, the number is returned with the (abs(d)) least significant digits of it's integer part set to 0. If d is not specified or nil/null it defaults to 0.
func (*Round) Children ¶
func (r *Round) Children() []sql.Expression
Children implements the Expression interface.
func (*Round) IsNullable ¶
IsNullable implements the Expression interface.
func (*Round) WithChildren ¶
func (r *Round) WithChildren(children ...sql.Expression) (sql.Expression, error)
WithChildren implements the Expression interface.
type Second ¶
type Second struct {
expression.UnaryExpression
}
Second is a function that returns the second of a date.
func (*Second) WithChildren ¶
func (s *Second) WithChildren(children ...sql.Expression) (sql.Expression, error)
WithChildren implements the Expression interface.
type SinFuncLogic ¶
type SinFuncLogic struct{}
SinFuncLogic is a UnaryMathFloatFuncWrapper implementation which returns the sin of a value
func (SinFuncLogic) EvalFloat ¶
func (fl SinFuncLogic) EvalFloat(n float64) (interface{}, error)
EvalFloat handles the case where the number argument passed is a float
type Sleep ¶
type Sleep struct {
expression.UnaryExpression
}
Sleep is a function that just waits for the specified number of seconds and returns 0. It can be useful to test timeouts or long queries.
func (*Sleep) IsNullable ¶
IsNullable implements the Expression interface.
func (*Sleep) WithChildren ¶
func (s *Sleep) WithChildren(children ...sql.Expression) (sql.Expression, error)
WithChildren implements the Expression interface.
type Soundex ¶
type Soundex struct {
expression.UnaryExpression
}
Soundex is a function that returns the soundex of a string. Two strings that sound almost the same should have identical soundex strings. A standard soundex string is four characters long, but the SOUNDEX() function returns an arbitrarily long string.
func (*Soundex) WithChildren ¶
func (s *Soundex) WithChildren(children ...sql.Expression) (sql.Expression, error)
WithChildren implements the Expression interface.
type Split ¶
type Split struct {
expression.BinaryExpression
}
Split receives a string and returns the parts of it splitted by a delimiter.
func (*Split) IsNullable ¶
IsNullable implements the Expression interface.
func (*Split) WithChildren ¶
func (f *Split) WithChildren(children ...sql.Expression) (sql.Expression, error)
WithChildren implements the Expression interface.
type Sqrt ¶
type Sqrt struct {
expression.UnaryExpression
}
Sqrt is a function that returns the square value of the number provided.
func (*Sqrt) IsNullable ¶
IsNullable implements the Expression interface.
func (*Sqrt) WithChildren ¶
func (s *Sqrt) WithChildren(children ...sql.Expression) (sql.Expression, error)
WithChildren implements the Expression interface.
type Substring ¶
type Substring struct {
// contains filtered or unexported fields
}
Substring is a function to return a part of a string. This function behaves as the homonym MySQL function. Since Go strings are UTF8, this function does not return a direct sub string str[start:start+length], instead returns the substring of rune s. That is, "á"[0:1] does not return a partial unicode glyph, but "á" itself.
func (*Substring) Children ¶
func (s *Substring) Children() []sql.Expression
Children implements the Expression interface.
func (*Substring) IsNullable ¶
IsNullable implements the Expression interface.
func (*Substring) WithChildren ¶
func (*Substring) WithChildren(children ...sql.Expression) (sql.Expression, error)
WithChildren implements the Expression interface.
type SubstringIndex ¶
type SubstringIndex struct {
// contains filtered or unexported fields
}
SubstringIndex returns the substring from string str before count occurrences of the delimiter delim. If count is positive, everything to the left of the final delimiter (counting from the left) is returned. If count is negative, everything to the right of the final delimiter (counting from the right) is returned. SUBSTRING_INDEX() performs a case-sensitive match when searching for delim.
func (*SubstringIndex) Children ¶
func (s *SubstringIndex) Children() []sql.Expression
Children implements the Expression interface.
func (*SubstringIndex) IsNullable ¶
func (s *SubstringIndex) IsNullable() bool
IsNullable implements the Expression interface.
func (*SubstringIndex) Resolved ¶
func (s *SubstringIndex) Resolved() bool
Resolved implements the Expression interface.
func (*SubstringIndex) String ¶
func (s *SubstringIndex) String() string
func (*SubstringIndex) Type ¶
func (*SubstringIndex) Type() sql.Type
Type implements the Expression interface.
func (*SubstringIndex) WithChildren ¶
func (s *SubstringIndex) WithChildren(children ...sql.Expression) (sql.Expression, error)
WithChildren implements the Expression interface.
type TanFuncLogic ¶
type TanFuncLogic struct{}
TanFuncLogic is a UnaryMathFloatFuncWrapper implementation which returns the tan of a value
func (TanFuncLogic) EvalFloat ¶
func (fl TanFuncLogic) EvalFloat(n float64) (interface{}, error)
EvalFloat handles the case where the number argument passed is a float
type TimestampConversion ¶
type TimestampConversion struct { Date sql.Expression // contains filtered or unexported fields }
TimestampConversion is a shorthand function for CONVERT(expr, TIMESTAMP)
func (*TimestampConversion) Children ¶
func (t *TimestampConversion) Children() []sql.Expression
func (*TimestampConversion) IsNullable ¶
func (t *TimestampConversion) IsNullable() bool
func (*TimestampConversion) Resolved ¶
func (t *TimestampConversion) Resolved() bool
func (*TimestampConversion) String ¶
func (t *TimestampConversion) String() string
func (*TimestampConversion) Type ¶
func (t *TimestampConversion) Type() sql.Type
func (*TimestampConversion) WithChildren ¶
func (t *TimestampConversion) WithChildren(children ...sql.Expression) (sql.Expression, error)
type ToBase64 ¶
type ToBase64 struct {
expression.UnaryExpression
}
ToBase64 is a function to encode a string to the Base64 format using the same dialect that MySQL's TO_BASE64 uses
func (*ToBase64) IsNullable ¶
IsNullable implements the Expression interface.
func (*ToBase64) WithChildren ¶
func (t *ToBase64) WithChildren(children ...sql.Expression) (sql.Expression, error)
WithChildren implements the Expression interface.
type Trim ¶
type Trim struct { expression.UnaryExpression // contains filtered or unexported fields }
Trim is a function that returns the string with prefix or suffix spaces removed based on the trimType
func (*Trim) IsNullable ¶
IsNullable implements the Expression interface.
func (*Trim) WithChildren ¶
func (t *Trim) WithChildren(children ...sql.Expression) (sql.Expression, error)
WithChildren implements the Expression interface.
type UnaryMathFloatFuncLogic ¶
type UnaryMathFloatFuncLogic interface { // EvalFloat contains sql function logic for a function that takes a single float64 as an argument EvalFloat(float64) (interface{}, error) }
UnaryMathFloatFuncLogic is an interface for sql function logic that takes a single float64 argument
type UnaryMathFloatFuncWrapper ¶
type UnaryMathFloatFuncWrapper struct {
FlLogic UnaryMathFloatFuncLogic
}
UnaryMathFloatFuncWrapper wraps logic that handles floats and provides methods for all number types
func (UnaryMathFloatFuncWrapper) EvalDecimal ¶
func (wr UnaryMathFloatFuncWrapper) EvalDecimal(dec decimal.Decimal) (interface{}, error)
EvalDecimal handles the case where the number argument passed is a decimal
func (UnaryMathFloatFuncWrapper) EvalFloat ¶
func (wr UnaryMathFloatFuncWrapper) EvalFloat(n float64) (interface{}, error)
EvalFloat handles the case where the number argument passed is a float
func (UnaryMathFloatFuncWrapper) EvalInt ¶
func (wr UnaryMathFloatFuncWrapper) EvalInt(n int64) (interface{}, error)
EvalInt handles the case where the number argument passed is an int
func (UnaryMathFloatFuncWrapper) EvalUint ¶
func (wr UnaryMathFloatFuncWrapper) EvalUint(n uint64) (interface{}, error)
EvalUint handles the case where the number argument passed is a uint
type UnaryMathFunc ¶
type UnaryMathFunc struct { expression.UnaryExpression // Name is the name of the function Name string // Logic contains the logic being executed when the function is called Logic UnaryMathFuncLogic }
UnaryMathFunc is a sql function that takes a single number argument and returns a value
func (*UnaryMathFunc) IsNullable ¶
func (mf *UnaryMathFunc) IsNullable() bool
IsNullable implements the Expression interface.
func (*UnaryMathFunc) String ¶
func (mf *UnaryMathFunc) String() string
String implements the Stringer interface.
func (*UnaryMathFunc) Type ¶
func (mf *UnaryMathFunc) Type() sql.Type
Type implements the Expression interface.
func (*UnaryMathFunc) WithChildren ¶
func (mf *UnaryMathFunc) WithChildren(children ...sql.Expression) (sql.Expression, error)
WithChildren implements the Expression interface.
type UnaryMathFuncLogic ¶
type UnaryMathFuncLogic interface { // UnaryMathFloatFuncLogic is an embedded interface that handles the case where the number arumend passed is a float UnaryMathFloatFuncLogic // EvalUint handles the case where the number argument passed is a uint EvalUint(uint64) (interface{}, error) // EvalInt handles the case where the number argument passed is an int EvalInt(int64) (interface{}, error) // EvalDecimal handles the case where the number argument passed is a decimal EvalDecimal(decimal.Decimal) (interface{}, error) }
UnaryMathFuncLogic is an interface for a sql function logic that takes a single number argument
func WrapUnaryMathFloatFuncLogic ¶
func WrapUnaryMathFloatFuncLogic(logic UnaryMathFloatFuncLogic) UnaryMathFuncLogic
WrapUnaryMathFloatFuncLogic takes a UnaryMathFloatFuncLogic and wraps it returning a UnaryMathFuncLogic implementation which uses the float implementation for all calls
type UnixTimestamp ¶
type UnixTimestamp struct { Date sql.Expression // contains filtered or unexported fields }
UnixTimestamp converts the argument to the number of seconds since 1970-01-01 00:00:00 UTC. With no argument, returns number of seconds since unix epoch for the current time.
func (*UnixTimestamp) Children ¶
func (ut *UnixTimestamp) Children() []sql.Expression
func (*UnixTimestamp) IsNullable ¶
func (ut *UnixTimestamp) IsNullable() bool
func (*UnixTimestamp) Resolved ¶
func (ut *UnixTimestamp) Resolved() bool
func (*UnixTimestamp) String ¶
func (ut *UnixTimestamp) String() string
func (*UnixTimestamp) Type ¶
func (ut *UnixTimestamp) Type() sql.Type
func (*UnixTimestamp) WithChildren ¶
func (ut *UnixTimestamp) WithChildren(children ...sql.Expression) (sql.Expression, error)
type Upper ¶
type Upper struct {
expression.UnaryExpression
}
Upper is a function that returns the UPPERCASE of the text provided.
func (*Upper) WithChildren ¶
func (u *Upper) WithChildren(children ...sql.Expression) (sql.Expression, error)
WithChildren implements the Expression interface.
type User ¶
type User struct{}
User returns the current user
func (User) Children ¶
func (User) Children() []sql.Expression
Children implements the sql.Expression interface.
func (User) IsNullable ¶
IsNullable implements the sql.Expression interface.
func (User) WithChildren ¶
func (c User) WithChildren(children ...sql.Expression) (sql.Expression, error)
WithChildren implements the Expression interface.
type Version ¶
type Version string
Version is a function that returns server version.
func (Version) Children ¶
func (f Version) Children() []sql.Expression
Children implements the Expression interface.
func (Version) IsNullable ¶
IsNullable implements the Expression interface.
func (Version) WithChildren ¶
func (f Version) WithChildren(children ...sql.Expression) (sql.Expression, error)
WithChildren implements the Expression interface.
type Weekday ¶
type Weekday struct {
expression.UnaryExpression
}
Weekday is a function that returns the weekday of a date where 0 = Monday, ..., 6 = Sunday.
func (*Weekday) WithChildren ¶
func (d *Weekday) WithChildren(children ...sql.Expression) (sql.Expression, error)
WithChildren implements the Expression interface.
type Year ¶
type Year struct {
expression.UnaryExpression
}
Year is a function that returns the year of a date.
func (*Year) WithChildren ¶
func (y *Year) WithChildren(children ...sql.Expression) (sql.Expression, error)
WithChildren implements the Expression interface.
type YearWeek ¶
type YearWeek struct {
// contains filtered or unexported fields
}
YearWeek is a function that returns year and week for a date. The year in the result may be different from the year in the date argument for the first and the last week of the year. Details: https://dev.mysql.com/doc/refman/5.5/en/date-and-time-functions.html#function_yearweek
func (*YearWeek) Children ¶
func (d *YearWeek) Children() []sql.Expression
Children implements the Expression interface.
func (*YearWeek) IsNullable ¶
IsNullable implements the Expression interface.
func (*YearWeek) WithChildren ¶
func (*YearWeek) WithChildren(children ...sql.Expression) (sql.Expression, error)
WithChildren implements the Expression interface.
Source Files
¶
- arraylength.go
- ceil_round_floor.go
- coalesce.go
- concat.go
- concat_ws.go
- connection_id.go
- database.go
- date.go
- explode.go
- greatest_least.go
- if.go
- ifnull.go
- isbinary.go
- json_extract.go
- json_unquote.go
- length.go
- logarithm.go
- lower_upper.go
- math.go
- nullif.go
- regexp_matches.go
- registry.go
- reverse_repeat_replace.go
- rpad_lpad.go
- sleep.go
- soundex.go
- split.go
- sqrt_power.go
- substring.go
- time.go
- tobase64_frombase64.go
- trim_ltrim_rtrim.go
- user.go
- version.go