function

package
v1.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 31, 2024 License: Apache-2.0 Imports: 51 Imported by: 0

Documentation

Index

Constants

View Source
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

View Source
var BuiltIns = []sql.Function{}/* 271 elements not displayed */

BuiltIns is the set of built-in functions any integrator can use

View Source
var ErrDivisionByZero = errors.NewKind("division by zero")
View Source
var ErrFunctionAlreadyRegistered = errors.NewKind("function '%s' is already registered")

ErrFunctionAlreadyRegistered is thrown when a function is already registered

View Source
var ErrIllegalLockNameArgType = errors.NewKind("Illegal parameter data type %s for operation '%s'")

ErrIllegalLockNameArgType is a kind of error that is thrown when the parameter passed as a lock name is not a string.

View Source
var ErrInvalidArgumentForLogarithm = errors.NewKind("invalid argument value for logarithm: %v")

ErrInvalidArgumentForLogarithm is returned when an invalid argument value is passed to a logarithm function

View Source
var ErrNegativeRepeatCount = errors.NewKind("negative Repeat count: %v")
View Source
var ErrTimeUnexpectedlyNil = errors.NewKind("time in function '%s' unexpectedly nil")

ErrTimeUnexpectedlyNil is thrown when a function encounters and unexpectedly nil time

View Source
var ErrTooHighPrecision = errors.NewKind("Too-big precision %d for '%s'. Maximum is %d.")
View Source
var ErrUintOverflow = errors.NewKind(
	"Unsigned integer too big to fit on signed integer")
View Source
var ErrUnknownType = errors.NewKind("function '%s' encountered unknown type %T")

ErrUnknownType is thrown when a function encounters and unknown type

View Source
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

Functions

func CreateNewGetLock

func CreateNewGetLock(ls *sql.LockSubsystem) func(e1, e2 sql.Expression) sql.Expression

CreateNewGetLock returns a new GetLock object

func GetLockingFuncs

func GetLockingFuncs(ls *sql.LockSubsystem) []sql.Function

func IsFreeLockFunc

func IsFreeLockFunc(_ *sql.Context, ls *sql.LockSubsystem, lockName string) (interface{}, error)

IsFreeLockFunc is the function logic that is executed when the is_free_lock function is called.

func IsUsedLockFunc

func IsUsedLockFunc(ctx *sql.Context, ls *sql.LockSubsystem, lockName string) (interface{}, error)

IsUsedLockFunc is the function logic that is executed when the is_used_lock function is called.

func NewAbsVal

func NewAbsVal(e sql.Expression) sql.Expression

NewAbsVal creates a new AbsVal expression.

func NewAcos

func NewAcos(arg sql.Expression) sql.Expression

NewAcos returns a new ACOS function expression

func NewAddDate

func NewAddDate(args ...sql.Expression) (sql.Expression, error)

NewAddDate returns a new function expression, or an error if one couldn't be created. The ADDDATE function is a synonym for DATE_ADD, with the one exception that if the second argument is NOT an explicitly declared interval, then the value is used and the interval period is assumed to be DAY. In either case, this function will actually return a *DateAdd struct.

func NewAscii

func NewAscii(arg sql.Expression) sql.Expression

func NewAsin

func NewAsin(arg sql.Expression) sql.Expression

NewAsin returns a new ASIN function expression

func NewAtan

func NewAtan(args ...sql.Expression) (sql.Expression, error)

NewAtan returns a new ATAN function expression

func NewBin

func NewBin(arg sql.Expression) sql.Expression

func NewBinToUUID

func NewBinToUUID(args ...sql.Expression) (sql.Expression, error)

func NewBitCount

func NewBitCount(arg sql.Expression) sql.Expression

NewBitCount creates a new Ceil expression.

func NewBitlength

func NewBitlength(arg sql.Expression) sql.Expression

func NewCeil

func NewCeil(num sql.Expression) sql.Expression

NewCeil creates a new Ceil expression.

func NewChar

func NewChar(args ...sql.Expression) (sql.Expression, error)

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 NewCoercibility

func NewCoercibility(e sql.Expression) sql.Expression

NewCoercibility creates a new Coercibility expression.

func NewCollation

func NewCollation(e sql.Expression) sql.Expression

NewCollation creates a new Collation 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

func NewConv

func NewConv(n, from, to sql.Expression) sql.Expression

NewConv returns a new Conv expression.

func NewConvertTz

func NewConvertTz(dt, fromTz, toTz sql.Expression) sql.Expression

NewConvertTz returns an implementation of the CONVERT_TZ() function.

func NewCos

func NewCos(arg sql.Expression) sql.Expression

NewCos returns a new COS function expression

func NewCot

func NewCot(arg sql.Expression) sql.Expression

NewCot returns a new COT function expression

func NewCrc32

func NewCrc32(arg sql.Expression) sql.Expression

NewCrc32 returns a new CRC32 function expression

func NewCurrDate

func NewCurrDate() sql.Expression

func NewCurrTime

func NewCurrTime(args ...sql.Expression) (sql.Expression, error)

func NewCurrentDate

func NewCurrentDate() sql.Expression

func NewCurrentUser

func NewCurrentUser() sql.Expression

func NewDatabase

func NewDatabase() sql.Expression

NewDatabase returns a new Database function

func NewDate

func NewDate(date sql.Expression) sql.Expression

NewDate returns a new Date node.

func NewDateAdd

func NewDateAdd(args ...sql.Expression) (sql.Expression, error)

NewDateAdd creates a new date add function.

func NewDateDiff

func NewDateDiff(expr1, expr2 sql.Expression) sql.Expression

NewDateDiff creates a new DATEDIFF() function.

func NewDateFormat

func NewDateFormat(ex, value sql.Expression) sql.Expression

NewDateFormat returns a new DateFormat UDF

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)

NewDatetime returns a DatetimeConversion instance to handle the sql function "datetime". This is not a standard mysql function, but provides a shorthand for datetime conversions.

func NewDay

func NewDay(date sql.Expression) sql.Expression

NewDay creates a new Day UDF.

func NewDayName

func NewDayName(arg sql.Expression) sql.Expression

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 NewDegrees

func NewDegrees(arg sql.Expression) sql.Expression

NewDegrees returns a new DEGREES function expression

func NewElt

func NewElt(args ...sql.Expression) (sql.Expression, error)

NewElt creates a new Elt UDF.

func NewExp

func NewExp(arg sql.Expression) sql.Expression

func NewExtract

func NewExtract(e1, e2 sql.Expression) sql.Expression

NewExtract creates a new Extract expression.

func NewField

func NewField(args ...sql.Expression) (sql.Expression, error)

NewField creates a new Field UDF.

func NewFindInSet

func NewFindInSet(e1, e2 sql.Expression) sql.Expression

NewFindInSet creates a new FindInSet expression.

func NewFloor

func NewFloor(num sql.Expression) sql.Expression

NewFloor returns a new Floor expression.

func NewFormat

func NewFormat(args ...sql.Expression) (sql.Expression, error)

NewFormat returns a new Format expression.

func NewFoundRows

func NewFoundRows() sql.Expression

func NewFromBase64

func NewFromBase64(e sql.Expression) sql.Expression

NewFromBase64 creates a new FromBase64 expression.

func NewFromUnixtime

func NewFromUnixtime(arg sql.Expression) sql.Expression

func NewGreatest

func NewGreatest(args ...sql.Expression) (sql.Expression, error)

NewGreatest creates a new Greatest UDF

func NewHex

func NewHex(arg sql.Expression) sql.Expression

func NewHour

func NewHour(date sql.Expression) sql.Expression

NewHour creates a new Hour 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 NewInet6Aton

func NewInet6Aton(val sql.Expression) sql.Expression

func NewInet6Ntoa

func NewInet6Ntoa(val sql.Expression) sql.Expression

func NewInetAton

func NewInetAton(val sql.Expression) sql.Expression

func NewInetNtoa

func NewInetNtoa(val sql.Expression) sql.Expression

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 NewIsFreeLock

func NewIsFreeLock(ls *sql.LockSubsystem) sql.CreateFunc1Args

func NewIsIPv4

func NewIsIPv4(val sql.Expression) sql.Expression

func NewIsIPv4Compat

func NewIsIPv4Compat(val sql.Expression) sql.Expression

func NewIsIPv4Mapped

func NewIsIPv4Mapped(val sql.Expression) sql.Expression

func NewIsIPv6

func NewIsIPv6(val sql.Expression) sql.Expression

func NewIsNull

func NewIsNull(e sql.Expression) sql.Expression

NewIsNull creates a new IsNull expression.

func NewIsUUID

func NewIsUUID(arg sql.Expression) sql.Expression

func NewIsUsedLock

func NewIsUsedLock(ls *sql.LockSubsystem) sql.CreateFunc1Args

func NewLastInsertId

func NewLastInsertId(children ...sql.Expression) (sql.Expression, error)

func NewLastInsertUuid

func NewLastInsertUuid(children ...sql.Expression) (sql.Expression, error)

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 NewLeftPad

func NewLeftPad(e ...sql.Expression) (sql.Expression, error)

func NewLeftTrim

func NewLeftTrim(str sql.Expression) sql.Expression

func NewLength

func NewLength(e sql.Expression) sql.Expression

NewLength returns a new LENGTH function.

func NewLoadFile

func NewLoadFile(fileName sql.Expression) sql.Expression

NewLoadFile returns a LoadFile object for the LOAD_FILE() function.

func NewLocate

func NewLocate(exprs ...sql.Expression) (sql.Expression, error)

NewLocate returns a new Locate 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 NewMD5

func NewMD5(arg sql.Expression) sql.Expression

NewMD5 returns a new MD5 function expression

func NewMicrosecond

func NewMicrosecond(arg sql.Expression) sql.Expression

func NewMinute

func NewMinute(date sql.Expression) sql.Expression

NewMinute creates a new Minute UDF.

func NewMod

func NewMod(args ...sql.Expression) (sql.Expression, error)

NewMod returns a new MOD function expression

func NewMonth

func NewMonth(date sql.Expression) sql.Expression

NewMonth creates a new Month UDF.

func NewMonthName

func NewMonthName(arg sql.Expression) sql.Expression

func NewNow

func NewNow(args ...sql.Expression) (sql.Expression, error)

NewNow returns a new Now node.

func NewNullIf

func NewNullIf(ex1, ex2 sql.Expression) sql.Expression

NewNullIf returns a new NULLIF UDF

func NewOrd

func NewOrd(arg sql.Expression) sql.Expression

func NewPad

func NewPad(pType padType, args ...sql.Expression) (sql.Expression, error)

NewPad creates a new Pad expression.

func NewPi

func NewPi() sql.Expression

func NewPower

func NewPower(e1, e2 sql.Expression) sql.Expression

NewPower creates a new Power expression.

func NewQuarter

func NewQuarter(date sql.Expression) sql.Expression

NewQuarter creates a new Month UDF.

func NewRadians

func NewRadians(arg sql.Expression) sql.Expression

NewRadians returns a new RADIANS function expression

func NewRand

func NewRand(exprs ...sql.Expression) (sql.Expression, error)

NewRand creates a new Rand expression.

func NewRandomBytes

func NewRandomBytes(e sql.Expression) sql.Expression

NewRandomBytes returns a new RANDOM_BYTES function.

func NewRegexpLike

func NewRegexpLike(args ...sql.Expression) (sql.Expression, error)

NewRegexpLike creates a new RegexpLike expression.

func NewRegexpReplace

func NewRegexpReplace(args ...sql.Expression) (sql.Expression, error)

NewRegexpReplace creates a new RegexpReplace expression.

func NewReleaseAllLocks

func NewReleaseAllLocks(ls *sql.LockSubsystem) func() sql.Expression

func NewReleaseLock

func NewReleaseLock(ls *sql.LockSubsystem) sql.CreateFunc1Args

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 NewRight

func NewRight(str, len sql.Expression) sql.Expression

NewRight creates a new RIGHT function.

func NewRightPad

func NewRightPad(e ...sql.Expression) (sql.Expression, error)

func NewRightTrim

func NewRightTrim(str sql.Expression) sql.Expression

func NewRound

func NewRound(args ...sql.Expression) (sql.Expression, error)

NewRound returns a new Round expression.

func NewRowCount

func NewRowCount() sql.Expression

func NewSHA1

func NewSHA1(arg sql.Expression) sql.Expression

NewSHA1 returns a new SHA1 function expression

func NewSHA2

func NewSHA2(arg, count sql.Expression) sql.Expression

NewSHA2 returns a new SHA2 function expression

func NewSecond

func NewSecond(date sql.Expression) sql.Expression

NewSecond creates a new Second UDF.

func NewSign

func NewSign(arg sql.Expression) sql.Expression

NewSign returns a new SIGN function expression

func NewSin

func NewSin(arg sql.Expression) sql.Expression

NewSin returns a new SIN function expression

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 NewSpace

func NewSpace(arg sql.Expression) sql.Expression

func NewSqrt

func NewSqrt(e sql.Expression) sql.Expression

NewSqrt creates a new Sqrt expression.

func NewStrCmp

func NewStrCmp(e1, e2 sql.Expression) sql.Expression

NewStrCmp creates a new NewStrCmp UDF.

func NewStrToDate

func NewStrToDate(args ...sql.Expression) (sql.Expression, error)

NewStrToDate constructs a new function expression from the given child expressions.

func NewSubDate

func NewSubDate(args ...sql.Expression) (sql.Expression, error)

NewSubDate returns a new function expression, or an error if one couldn't be created. The SUBDATE function is a synonym for DATE_SUB, with the one exception that if the second argument is NOT an explicitly declared interval, then the value is used and the interval period is assumed to be DAY. In either case, this function will actually return a *DateSub struct.

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 NewSysdate

func NewSysdate(args ...sql.Expression) (sql.Expression, error)

NewSysdate returns a new SYSDATE() function, using the supplied |args| for an optional value for fractional second precision. The SYSDATE() function is a synonym for NOW(), but does NOT use the query's cached start time, and instead always returns the current time, even when executed multiple times in a query or stored procedure. https://dev.mysql.com/doc/refman/8.0/en/date-and-time-functions.html#function_sysdate

func NewTan

func NewTan(arg sql.Expression) sql.Expression

NewTan returns a new TAN function expression

func NewTime

func NewTime(time sql.Expression) sql.Expression

NewTime returns a new Date node.

func NewTimeDiff

func NewTimeDiff(e1, e2 sql.Expression) sql.Expression

NewTimeDiff creates a new NewTimeDiff expression.

func NewTimeFormat

func NewTimeFormat(ex, value sql.Expression) sql.Expression

NewTimeFormat returns a new TimeFormat UDF

func NewTimeToSec

func NewTimeToSec(arg sql.Expression) sql.Expression

func NewTimestamp

func NewTimestamp(args ...sql.Expression) (sql.Expression, error)

func NewTimestampDiff

func NewTimestampDiff(u, e1, e2 sql.Expression) sql.Expression

NewTimestampDiff creates a new TIMESTAMPDIFF() function.

func NewToBase64

func NewToBase64(e sql.Expression) sql.Expression

NewToBase64 creates a new ToBase64 expression.

func NewTrim

func NewTrim(str sql.Expression, pat sql.Expression, dir string) sql.Expression

func NewUTCTimestamp

func NewUTCTimestamp(args ...sql.Expression) (sql.Expression, error)

NewUTCTimestamp returns a new UTCTimestamp node.

func NewUUIDFunc

func NewUUIDFunc() sql.Expression

func NewUUIDToBin

func NewUUIDToBin(args ...sql.Expression) (sql.Expression, error)

func NewUnhex

func NewUnhex(arg sql.Expression) sql.Expression

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 NewUser

func NewUser() sql.Expression

func NewValues

func NewValues(col sql.Expression) sql.Expression

NewValues creates a new Values function.

func NewVersion

func NewVersion(versionPostfix string) func(...sql.Expression) (sql.Expression, error)

NewVersion creates a new Version UDF.

func NewWeek

func NewWeek(args ...sql.Expression) (sql.Expression, error)

NewWeek creates a new Week UDF

func NewWeekOfYear

func NewWeekOfYear(arg sql.Expression) sql.Expression

func NewWeekday

func NewWeekday(date sql.Expression) sql.Expression

NewWeekday creates a new Weekday UDF.

func NewYear

func NewYear(date sql.Expression) sql.Expression

NewYear creates a new Year UDF.

func NewYearWeek

func NewYearWeek(args ...sql.Expression) (sql.Expression, error)

NewYearWeek creates a new YearWeek UDF

func NoArgFuncWithChildren

func NoArgFuncWithChildren(fn sql.Expression, children []sql.Expression) (sql.Expression, error)

WithChildren implements the Expression interface.

func ReleaseLockFunc

func ReleaseLockFunc(ctx *sql.Context, ls *sql.LockSubsystem, lockName string) (interface{}, error)

ReleaseLockFunc is the function logic that is executed when the release_lock function is called.

func SessionTimeZone

func SessionTimeZone(ctx *sql.Context) (string, error)

SessionTimeZone returns a MySQL timezone offset string for the value of @@session_time_zone. If the session timezone is set to SYSTEM, then the system timezone offset is calculated and returned.

Types

type AbsVal

type AbsVal struct {
	expression.UnaryExpression
}

AbsVal is a function that takes the absolute value of a number

func (*AbsVal) CollationCoercibility

func (*AbsVal) CollationCoercibility(ctx *sql.Context) (collation sql.CollationID, coercibility byte)

CollationCoercibility implements the interface sql.CollationCoercible.

func (*AbsVal) Description

func (t *AbsVal) Description() string

Description implements sql.FunctionExpression

func (*AbsVal) Eval

func (t *AbsVal) Eval(ctx *sql.Context, row sql.Row) (interface{}, error)

Eval implements the Expression interface.

func (*AbsVal) FunctionName

func (t *AbsVal) FunctionName() string

FunctionName implements sql.FunctionExpression

func (*AbsVal) IsNullable

func (t *AbsVal) IsNullable() bool

IsNullable implements the Expression interface.

func (*AbsVal) String

func (t *AbsVal) String() string

String implements the fmt.Stringer interface.

func (*AbsVal) Type

func (t *AbsVal) Type() sql.Type

Type implements the Expression interface.

func (*AbsVal) WithChildren

func (t *AbsVal) WithChildren(children ...sql.Expression) (sql.Expression, error)

WithChildren implements the Expression interface.

type Acos

type Acos struct {
	*UnaryFunc
}

func (*Acos) CollationCoercibility

func (*Acos) CollationCoercibility(ctx *sql.Context) (collation sql.CollationID, coercibility byte)

CollationCoercibility implements the interface sql.CollationCoercible.

func (*Acos) Description

func (a *Acos) Description() string

Description implements sql.FunctionExpression

func (*Acos) Eval

func (a *Acos) Eval(ctx *sql.Context, row sql.Row) (interface{}, error)

Eval implements sql.Expression

func (*Acos) WithChildren

func (a *Acos) WithChildren(children ...sql.Expression) (sql.Expression, error)

WithChildren implements sql.Expression

type AppendFuncWrapper

type AppendFuncWrapper struct {
	// contains filtered or unexported fields
}

func (AppendFuncWrapper) Append

func (af AppendFuncWrapper) Append(bytes []byte, t time.Time) []byte

type Ascii

type Ascii struct {
	*UnaryFunc
}

Ascii implements the sql function "ascii" which returns the numeric value of the leftmost character

func (*Ascii) CollationCoercibility

func (*Ascii) CollationCoercibility(ctx *sql.Context) (collation sql.CollationID, coercibility byte)

CollationCoercibility implements the interface sql.CollationCoercible.

func (*Ascii) Description

func (a *Ascii) Description() string

Description implements sql.FunctionExpression

func (*Ascii) Eval

func (a *Ascii) Eval(ctx *sql.Context, row sql.Row) (interface{}, error)

Eval implements the sql.Expression interface

func (*Ascii) WithChildren

func (a *Ascii) WithChildren(children ...sql.Expression) (sql.Expression, error)

WithChildren implements the sql.Expression interface

type Asin

type Asin struct {
	*UnaryFunc
}

func (*Asin) CollationCoercibility

func (*Asin) CollationCoercibility(ctx *sql.Context) (collation sql.CollationID, coercibility byte)

CollationCoercibility implements the interface sql.CollationCoercible.

func (*Asin) Description

func (a *Asin) Description() string

Description implements sql.FunctionExpression

func (*Asin) Eval

func (a *Asin) Eval(ctx *sql.Context, row sql.Row) (interface{}, error)

Eval implements sql.Expression

func (*Asin) WithChildren

func (a *Asin) WithChildren(children ...sql.Expression) (sql.Expression, error)

WithChildren implements sql.Expression

type Atan

type Atan struct {
	// contains filtered or unexported fields
}

func (*Atan) Children

func (a *Atan) Children() []sql.Expression

Children implements sql.Expression

func (*Atan) CollationCoercibility

func (*Atan) CollationCoercibility(ctx *sql.Context) (collation sql.CollationID, coercibility byte)

CollationCoercibility implements the interface sql.CollationCoercible.

func (*Atan) Description

func (a *Atan) Description() string

Description implements sql.FunctionExpression

func (*Atan) Eval

func (a *Atan) Eval(ctx *sql.Context, row sql.Row) (interface{}, error)

Eval implements sql.Expression

func (*Atan) FunctionName

func (a *Atan) FunctionName() string

FunctionName implements sql.FunctionExpression

func (*Atan) IsNullable

func (a *Atan) IsNullable() bool

IsNullable implements sql.Expression

func (*Atan) Resolved

func (a *Atan) Resolved() bool

Resolved implements sql.Expression

func (*Atan) String

func (a *Atan) String() string

String implements sql.Expression

func (*Atan) Type

func (a *Atan) Type() sql.Type

Type implements sql.Expression

func (*Atan) WithChildren

func (a *Atan) WithChildren(children ...sql.Expression) (sql.Expression, error)

WithChildren implements sql.Expression

type Bin

type Bin struct {
	*UnaryFunc
}

Bin implements the sql function "bin" which returns the binary representation of a number

func (*Bin) CollationCoercibility

func (*Bin) CollationCoercibility(ctx *sql.Context) (collation sql.CollationID, coercibility byte)

CollationCoercibility implements the interface sql.CollationCoercible.

func (*Bin) Description

func (b *Bin) Description() string

Description implements sql.FunctionExpression

func (*Bin) Eval

func (h *Bin) Eval(ctx *sql.Context, row sql.Row) (interface{}, error)

Eval implements the sql.Expression interface

func (*Bin) FunctionName

func (b *Bin) FunctionName() string

FunctionName implements sql.FunctionExpression

func (*Bin) WithChildren

func (h *Bin) WithChildren(children ...sql.Expression) (sql.Expression, error)

WithChildren implements the sql.Expression interface

type BinToUUID

type BinToUUID struct {
	// contains filtered or unexported fields
}

func (BinToUUID) Children

func (bu BinToUUID) Children() []sql.Expression

Children returns the children expressions of this expression.

func (BinToUUID) CollationCoercibility

func (BinToUUID) CollationCoercibility(ctx *sql.Context) (collation sql.CollationID, coercibility byte)

CollationCoercibility implements the interface sql.CollationCoercible.

func (BinToUUID) Description

func (bu BinToUUID) Description() string

Description implements sql.FunctionExpression

func (BinToUUID) Eval

func (bu BinToUUID) Eval(ctx *sql.Context, row sql.Row) (interface{}, error)

func (BinToUUID) FunctionName

func (bu BinToUUID) FunctionName() string

FunctionName implements sql.FunctionExpression

func (BinToUUID) IsNullable

func (bu BinToUUID) IsNullable() bool

IsNullable returns whether the expression can be null.

func (BinToUUID) Resolved

func (bu BinToUUID) Resolved() bool

func (BinToUUID) String

func (bu BinToUUID) String() string

func (BinToUUID) Type

func (bu BinToUUID) Type() sql.Type

func (BinToUUID) WithChildren

func (bu BinToUUID) WithChildren(children ...sql.Expression) (sql.Expression, error)

type BitCount

type BitCount struct {
	*UnaryFunc
}

BitCount returns the smallest integer value not less than X.

func (*BitCount) CollationCoercibility

func (b *BitCount) CollationCoercibility(ctx *sql.Context) (collation sql.CollationID, coercibility byte)

CollationCoercibility implements the interface sql.CollationCoercible.

func (*BitCount) Description

func (b *BitCount) Description() string

Description implements sql.FunctionExpression

func (*BitCount) Eval

func (b *BitCount) Eval(ctx *sql.Context, row sql.Row) (interface{}, error)

Eval implements the Expression interface.

func (*BitCount) FunctionName

func (b *BitCount) FunctionName() string

FunctionName implements sql.FunctionExpression

func (*BitCount) String

func (b *BitCount) String() string

func (*BitCount) Type

func (b *BitCount) Type() sql.Type

Type implements the Expression interface.

func (*BitCount) WithChildren

func (b *BitCount) WithChildren(children ...sql.Expression) (sql.Expression, error)

WithChildren implements the Expression interface.

type Bitlength

type Bitlength struct {
	*UnaryFunc
}

Bitlength implements the sql function "bit_length" which returns the data length of the argument in bits

func (*Bitlength) CollationCoercibility

func (*Bitlength) CollationCoercibility(ctx *sql.Context) (collation sql.CollationID, coercibility byte)

CollationCoercibility implements the interface sql.CollationCoercible.

func (*Bitlength) Description

func (b *Bitlength) Description() string

Description implements sql.FunctionExpression

func (*Bitlength) Eval

func (h *Bitlength) Eval(ctx *sql.Context, row sql.Row) (interface{}, error)

Eval implements the sql.Expression interface

func (*Bitlength) FunctionName

func (b *Bitlength) FunctionName() string

FunctionName implements sql.FunctionExpression

func (*Bitlength) WithChildren

func (h *Bitlength) WithChildren(children ...sql.Expression) (sql.Expression, error)

WithChildren implements the sql.Expression interface

type Ceil

type Ceil struct {
	expression.UnaryExpression
}

Ceil returns the smallest integer value not less than X.

func (*Ceil) CollationCoercibility

func (*Ceil) CollationCoercibility(ctx *sql.Context) (collation sql.CollationID, coercibility byte)

CollationCoercibility implements the interface sql.CollationCoercible.

func (*Ceil) Description

func (c *Ceil) Description() string

Description implements sql.FunctionExpression

func (*Ceil) Eval

func (c *Ceil) Eval(ctx *sql.Context, row sql.Row) (interface{}, error)

Eval implements the Expression interface.

func (*Ceil) FunctionName

func (c *Ceil) FunctionName() string

FunctionName implements sql.FunctionExpression

func (*Ceil) String

func (c *Ceil) String() string

func (*Ceil) Type

func (c *Ceil) Type() sql.Type

Type implements the Expression interface.

func (*Ceil) WithChildren

func (c *Ceil) WithChildren(children ...sql.Expression) (sql.Expression, error)

WithChildren implements the Expression interface.

type Char

type Char struct {
	Collation sql.CollationID
	// contains filtered or unexported fields
}

Char implements the sql function "char" which returns the character for each integer passed

func (*Char) Children

func (c *Char) Children() []sql.Expression

Children implements sql.Expression

func (*Char) CollationCoercibility

func (c *Char) CollationCoercibility(ctx *sql.Context) (collation sql.CollationID, coercibility byte)

CollationCoercibility implements the interface sql.CollationCoercible.

func (*Char) Description

func (c *Char) Description() string

Description implements sql.FunctionExpression

func (*Char) Eval

func (c *Char) Eval(ctx *sql.Context, row sql.Row) (interface{}, error)

Eval implements the sql.Expression interface

func (*Char) FunctionName

func (c *Char) FunctionName() string

FunctionName implements sql.FunctionExpression

func (*Char) IsNullable

func (c *Char) IsNullable() bool

IsNullable implements sql.Expression

func (*Char) Resolved

func (c *Char) Resolved() bool

Resolved implements sql.FunctionExpression

func (*Char) String

func (c *Char) String() string

String implements sql.Expression

func (*Char) Type

func (c *Char) Type() sql.Type

Type implements sql.Expression

func (*Char) WithChildren

func (c *Char) WithChildren(children ...sql.Expression) (sql.Expression, error)

WithChildren implements the sql.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) CollationCoercibility

func (c *Coalesce) CollationCoercibility(ctx *sql.Context) (collation sql.CollationID, coercibility byte)

CollationCoercibility implements the interface sql.CollationCoercible.

func (*Coalesce) DebugString

func (c *Coalesce) DebugString() string

func (*Coalesce) Description

func (c *Coalesce) Description() string

Description implements sql.FunctionExpression

func (*Coalesce) Eval

func (c *Coalesce) Eval(ctx *sql.Context, row sql.Row) (interface{}, error)

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) FunctionName

func (c *Coalesce) FunctionName() string

FunctionName implements sql.FunctionExpression

func (*Coalesce) IsNullable

func (c *Coalesce) IsNullable() bool

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

func (c *Coalesce) Resolved() bool

Resolved implements the sql.Expression interface. The function checks if first non-nil argument is resolved.

func (*Coalesce) String

func (c *Coalesce) String() string

func (*Coalesce) Type

func (c *Coalesce) Type() sql.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 Coercibility

type Coercibility struct {
	expression.UnaryExpression
}

Coercibility is a function that returns the coercibility of the inner expression.

func (*Coercibility) CollationCoercibility

func (*Coercibility) CollationCoercibility(ctx *sql.Context) (collation sql.CollationID, coercibility byte)

CollationCoercibility implements the interface sql.CollationCoercible.

func (*Coercibility) Description

func (c *Coercibility) Description() string

Description implements sql.FunctionExpression

func (*Coercibility) Eval

func (c *Coercibility) Eval(ctx *sql.Context, row sql.Row) (interface{}, error)

Eval implements the sql.Expression.

func (*Coercibility) FunctionName

func (c *Coercibility) FunctionName() string

FunctionName implements sql.FunctionExpression

func (*Coercibility) String

func (c *Coercibility) String() string

String implements the fmt.Stringer interface.

func (*Coercibility) Type

func (c *Coercibility) Type() sql.Type

Type implements the Expression interface.

func (*Coercibility) WithChildren

func (c *Coercibility) WithChildren(children ...sql.Expression) (sql.Expression, error)

WithChildren implements the Expression interface.

type Collation

type Collation struct {
	expression.UnaryExpression
}

Collation is a function that returns the collation of the inner expression.

func (*Collation) CollationCoercibility

func (*Collation) CollationCoercibility(ctx *sql.Context) (collation sql.CollationID, coercibility byte)

CollationCoercibility implements the interface sql.CollationCoercible.

func (*Collation) Description

func (c *Collation) Description() string

Description implements sql.FunctionExpression

func (*Collation) Eval

func (c *Collation) Eval(ctx *sql.Context, row sql.Row) (interface{}, error)

Eval implements the sql.Expression.

func (*Collation) FunctionName

func (c *Collation) FunctionName() string

FunctionName implements sql.FunctionExpression

func (*Collation) String

func (c *Collation) String() string

String implements the fmt.Stringer interface.

func (*Collation) Type

func (c *Collation) Type() sql.Type

Type implements the Expression interface.

func (*Collation) WithChildren

func (c *Collation) 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 (c *Concat) Children() []sql.Expression

Children implements the Expression interface.

func (*Concat) CollationCoercibility

func (c *Concat) CollationCoercibility(ctx *sql.Context) (collation sql.CollationID, coercibility byte)

CollationCoercibility implements the interface sql.CollationCoercible.

func (*Concat) DebugString

func (c *Concat) DebugString() string

func (*Concat) Description

func (c *Concat) Description() string

Description implements sql.FunctionExpression

func (*Concat) Eval

func (c *Concat) Eval(ctx *sql.Context, row sql.Row) (interface{}, error)

Eval implements the Expression interface.

func (*Concat) FunctionName

func (c *Concat) FunctionName() string

FunctionName implements sql.FunctionExpression

func (*Concat) IsNullable

func (c *Concat) IsNullable() bool

IsNullable implements the Expression interface.

func (*Concat) Resolved

func (c *Concat) Resolved() bool

Resolved implements the Expression interface.

func (*Concat) String

func (c *Concat) String() string

func (*Concat) Type

func (c *Concat) Type() sql.Type

Type 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) CollationCoercibility

func (c *ConcatWithSeparator) CollationCoercibility(ctx *sql.Context) (collation sql.CollationID, coercibility byte)

CollationCoercibility implements the interface sql.CollationCoercible.

func (*ConcatWithSeparator) Description

func (f *ConcatWithSeparator) Description() string

Description implements sql.FunctionExpression

func (*ConcatWithSeparator) Eval

func (f *ConcatWithSeparator) Eval(ctx *sql.Context, row sql.Row) (interface{}, error)

Eval implements the Expression interface.

func (*ConcatWithSeparator) FunctionName

func (f *ConcatWithSeparator) FunctionName() string

FunctionName implements sql.FunctionExpression

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 {
	NoArgFunc
}

func (ConnectionID) CollationCoercibility

func (ConnectionID) CollationCoercibility(ctx *sql.Context) (collation sql.CollationID, coercibility byte)

CollationCoercibility implements the interface sql.CollationCoercible.

func (ConnectionID) Description

func (c ConnectionID) Description() string

Description implements sql.FunctionExpression

func (ConnectionID) Eval

func (c ConnectionID) Eval(ctx *sql.Context, row sql.Row) (interface{}, error)

Eval implements sql.Expression

func (ConnectionID) FunctionName

func (c ConnectionID) FunctionName() string

FunctionName implements sql.FunctionExpression

func (ConnectionID) IsNonDeterministic

func (c ConnectionID) IsNonDeterministic() bool

func (ConnectionID) WithChildren

func (c ConnectionID) WithChildren(children ...sql.Expression) (sql.Expression, error)

WithChildren implements sql.Expression

type Conv

type Conv struct {
	// contains filtered or unexported fields
}

Conv function converts numbers between different number bases. Returns a string representation of the number N, converted from base from_base to base to_base.

func (*Conv) Children

func (c *Conv) Children() []sql.Expression

Children implements the Expression interface.

func (*Conv) CollationCoercibility

func (*Conv) CollationCoercibility(ctx *sql.Context) (collation sql.CollationID, coercibility byte)

CollationCoercibility implements the interface sql.CollationCoercible.

func (*Conv) Description

func (c *Conv) Description() string

Description implements sql.FunctionExpression

func (*Conv) Eval

func (c *Conv) Eval(ctx *sql.Context, row sql.Row) (interface{}, error)

Eval implements the Expression interface.

func (*Conv) FunctionName

func (c *Conv) FunctionName() string

FunctionName implements sql.FunctionExpression

func (*Conv) IsNullable

func (c *Conv) IsNullable() bool

IsNullable implements the Expression interface.

func (*Conv) Resolved

func (c *Conv) Resolved() bool

Resolved implements the Expression interface.

func (*Conv) String

func (c *Conv) String() string

func (*Conv) Type

func (c *Conv) Type() sql.Type

Type implements the Expression interface.

func (*Conv) WithChildren

func (c *Conv) WithChildren(children ...sql.Expression) (sql.Expression, error)

WithChildren implements the Expression interface.

type ConvertTz

type ConvertTz struct {
	// contains filtered or unexported fields
}

func (*ConvertTz) Children

func (c *ConvertTz) Children() []sql.Expression

Children implements the sql.Expression interface.

func (*ConvertTz) CollationCoercibility

func (*ConvertTz) CollationCoercibility(ctx *sql.Context) (collation sql.CollationID, coercibility byte)

CollationCoercibility implements the interface sql.CollationCoercible.

func (*ConvertTz) Description

func (c *ConvertTz) Description() string

Description implements the sql.FunctionExpression interface.

func (*ConvertTz) Eval

func (c *ConvertTz) Eval(ctx *sql.Context, row sql.Row) (interface{}, error)

Eval implements the sql.Expression interface.

func (*ConvertTz) FunctionName

func (c *ConvertTz) FunctionName() string

FunctionName implements sql.FunctionExpression

func (*ConvertTz) IsNullable

func (c *ConvertTz) IsNullable() bool

IsNullable implements the sql.Expression interface.

func (*ConvertTz) Resolved

func (c *ConvertTz) Resolved() bool

Resolved implements the sql.Expression interface.

func (*ConvertTz) String

func (c *ConvertTz) String() string

String implements the sql.Expression interface.

func (*ConvertTz) Type

func (c *ConvertTz) Type() sql.Type

Type implements the sql.Expression interface.

func (*ConvertTz) WithChildren

func (c *ConvertTz) WithChildren(children ...sql.Expression) (sql.Expression, error)

WithChildren implements the sql.Expression interface.

type Cos

type Cos struct {
	*UnaryFunc
}

func (*Cos) CollationCoercibility

func (*Cos) CollationCoercibility(ctx *sql.Context) (collation sql.CollationID, coercibility byte)

CollationCoercibility implements the interface sql.CollationCoercible.

func (*Cos) Description

func (s *Cos) Description() string

Description implements sql.FunctionExpression

func (*Cos) Eval

func (s *Cos) Eval(ctx *sql.Context, row sql.Row) (interface{}, error)

Eval implements sql.Expression

func (*Cos) WithChildren

func (c *Cos) WithChildren(children ...sql.Expression) (sql.Expression, error)

WithChildren implements sql.Expression

type Cot

type Cot struct {
	*UnaryFunc
}

func (*Cot) CollationCoercibility

func (*Cot) CollationCoercibility(ctx *sql.Context) (collation sql.CollationID, coercibility byte)

CollationCoercibility implements the interface sql.CollationCoercible.

func (*Cot) Description

func (c *Cot) Description() string

Description implements sql.FunctionExpression

func (*Cot) Eval

func (c *Cot) Eval(ctx *sql.Context, row sql.Row) (interface{}, error)

Eval implements sql.Expression

func (*Cot) WithChildren

func (c *Cot) WithChildren(children ...sql.Expression) (sql.Expression, error)

WithChildren implements sql.Expression

type CountType

type CountType bool

CountType is the kind of length count.

type Crc32

type Crc32 struct {
	*UnaryFunc
}

func (*Crc32) CollationCoercibility

func (*Crc32) CollationCoercibility(ctx *sql.Context) (collation sql.CollationID, coercibility byte)

CollationCoercibility implements the interface sql.CollationCoercible.

func (*Crc32) Description

func (c *Crc32) Description() string

Description implements sql.FunctionExpression

func (*Crc32) Eval

func (c *Crc32) Eval(ctx *sql.Context, row sql.Row) (interface{}, error)

Eval implements sql.Expression

func (*Crc32) WithChildren

func (c *Crc32) WithChildren(children ...sql.Expression) (sql.Expression, error)

WithChildren implements sql.Expression

type CurrDate

type CurrDate struct {
	NoArgFunc
}

func (CurrDate) CollationCoercibility

func (CurrDate) CollationCoercibility(ctx *sql.Context) (collation sql.CollationID, coercibility byte)

CollationCoercibility implements the interface sql.CollationCoercible.

func (CurrDate) Description

func (c CurrDate) Description() string

Description implements sql.FunctionExpression

func (CurrDate) Eval

func (c CurrDate) Eval(ctx *sql.Context, row sql.Row) (interface{}, error)

Eval implements sql.Expression

func (CurrDate) IsNonDeterministic

func (c CurrDate) IsNonDeterministic() bool

func (CurrDate) WithChildren

func (c CurrDate) WithChildren(children ...sql.Expression) (sql.Expression, error)

WithChildren implements sql.Expression

type CurrTime

type CurrTime struct {
	// contains filtered or unexported fields
}

func (*CurrTime) Children

func (c *CurrTime) Children() []sql.Expression

Children implements the sql.Expression interface.

func (*CurrTime) CollationCoercibility

func (*CurrTime) CollationCoercibility(ctx *sql.Context) (collation sql.CollationID, coercibility byte)

CollationCoercibility implements the interface sql.CollationCoercible.

func (*CurrTime) Description

func (c *CurrTime) Description() string

Description implements sql.FunctionExpression

func (*CurrTime) Eval

func (c *CurrTime) Eval(ctx *sql.Context, row sql.Row) (interface{}, error)

Eval implements sql.Expression

func (*CurrTime) FunctionName

func (c *CurrTime) FunctionName() string

FunctionName implements sql.FunctionExpression

func (CurrTime) IsNonDeterministic

func (c CurrTime) IsNonDeterministic() bool

func (*CurrTime) IsNullable

func (c *CurrTime) IsNullable() bool

IsNullable implements the sql.Expression interface.

func (*CurrTime) Resolved

func (c *CurrTime) Resolved() bool

Resolved implements the sql.Expression interface.

func (*CurrTime) String

func (c *CurrTime) String() string

String implements the sql.Expression interface.

func (*CurrTime) Type

func (c *CurrTime) Type() sql.Type

Type implements the sql.Expression interface.

func (*CurrTime) WithChildren

func (c *CurrTime) WithChildren(children ...sql.Expression) (sql.Expression, error)

WithChildren implements sql.Expression

type Database

type Database struct{}

Database implements the DATABASE() function

func (*Database) Children

func (db *Database) Children() []sql.Expression

Children implements the sql.Expression interface.

func (*Database) CollationCoercibility

func (*Database) CollationCoercibility(ctx *sql.Context) (collation sql.CollationID, coercibility byte)

CollationCoercibility implements the interface sql.CollationCoercible.

func (*Database) Description

func (db *Database) Description() string

Description implements sql.FunctionExpression

func (*Database) Eval

func (db *Database) Eval(ctx *sql.Context, row sql.Row) (interface{}, error)

Eval implements the sql.Expression interface.

func (*Database) FunctionName

func (db *Database) FunctionName() string

FunctionName implements sql.FunctionExpression

func (*Database) IsNonDeterministic

func (db *Database) IsNonDeterministic() bool

func (*Database) IsNullable

func (db *Database) IsNullable() bool

IsNullable implements the sql.Expression interface. The function returns always true

func (*Database) Resolved

func (db *Database) Resolved() bool

Resolved implements the sql.Expression interface.

func (*Database) String

func (db *Database) String() string

func (*Database) Type

func (db *Database) Type() sql.Type

Type implements the sql.Expression (sql.LongText)

func (*Database) WithChildren

func (db *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) CollationCoercibility

func (*Date) CollationCoercibility(ctx *sql.Context) (collation sql.CollationID, coercibility byte)

CollationCoercibility implements the interface sql.CollationCoercible.

func (*Date) Description

func (d *Date) Description() string

Description implements sql.FunctionExpression

func (*Date) Eval

func (d *Date) Eval(ctx *sql.Context, row sql.Row) (interface{}, error)

Eval implements the Expression interface.

func (*Date) FunctionName

func (d *Date) FunctionName() string

FunctionName implements sql.FunctionExpression

func (*Date) String

func (d *Date) String() string

func (*Date) Type

func (d *Date) Type() sql.Type

Type implements the Expression interface.

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) CollationCoercibility

func (*DateAdd) CollationCoercibility(ctx *sql.Context) (collation sql.CollationID, coercibility byte)

CollationCoercibility implements the interface sql.CollationCoercible.

func (*DateAdd) Description

func (d *DateAdd) Description() string

Description implements sql.FunctionExpression

func (*DateAdd) Eval

func (d *DateAdd) Eval(ctx *sql.Context, row sql.Row) (interface{}, error)

Eval implements the sql.Expression interface.

func (*DateAdd) FunctionName

func (d *DateAdd) FunctionName() string

FunctionName implements sql.FunctionExpression

func (*DateAdd) IsNullable

func (d *DateAdd) IsNullable() bool

IsNullable implements the sql.Expression interface.

func (*DateAdd) Resolved

func (d *DateAdd) Resolved() bool

Resolved implements the sql.Expression interface.

func (*DateAdd) String

func (d *DateAdd) String() string

func (*DateAdd) Type

func (d *DateAdd) Type() sql.Type

Type implements the sql.Expression interface.

func (*DateAdd) WithChildren

func (d *DateAdd) WithChildren(children ...sql.Expression) (sql.Expression, error)

WithChildren implements the Expression interface.

type DateDiff

type DateDiff struct {
	expression.BinaryExpressionStub
}

DateDiff returns expr1 − expr2 expressed as a value in days from one date to the other.

func (*DateDiff) CollationCoercibility

func (*DateDiff) CollationCoercibility(ctx *sql.Context) (collation sql.CollationID, coercibility byte)

CollationCoercibility implements the interface sql.CollationCoercible.

func (*DateDiff) Description

func (d *DateDiff) Description() string

Description implements sql.FunctionExpression

func (*DateDiff) Eval

func (d *DateDiff) Eval(ctx *sql.Context, row sql.Row) (interface{}, error)

Eval implements the sql.Expression interface.

func (*DateDiff) FunctionName

func (d *DateDiff) FunctionName() string

FunctionName implements sql.FunctionExpression

func (*DateDiff) String

func (d *DateDiff) String() string

func (*DateDiff) Type

func (d *DateDiff) Type() sql.Type

Type implements the sql.Expression interface.

func (*DateDiff) WithChildren

func (d *DateDiff) WithChildren(children ...sql.Expression) (sql.Expression, error)

WithChildren implements the Expression interface.

type DateFormat

type DateFormat struct {
	expression.BinaryExpressionStub
}

DateFormat function returns a string representation of the date specified in the format specified

func (*DateFormat) CollationCoercibility

func (*DateFormat) CollationCoercibility(ctx *sql.Context) (collation sql.CollationID, coercibility byte)

CollationCoercibility implements the interface sql.CollationCoercible.

func (*DateFormat) Description

func (f *DateFormat) Description() string

Description implements sql.FunctionExpression

func (*DateFormat) Eval

func (f *DateFormat) Eval(ctx *sql.Context, row sql.Row) (interface{}, error)

Eval implements the Expression interface.

func (*DateFormat) FunctionName

func (f *DateFormat) FunctionName() string

FunctionName implements sql.FunctionExpression

func (*DateFormat) IsNullable

func (f *DateFormat) IsNullable() bool

IsNullable implements the Expression interface.

func (*DateFormat) String

func (f *DateFormat) String() string

func (*DateFormat) Type

func (f *DateFormat) Type() sql.Type

Type implements the Expression interface.

func (*DateFormat) WithChildren

func (f *DateFormat) 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) CollationCoercibility

func (*DateSub) CollationCoercibility(ctx *sql.Context) (collation sql.CollationID, coercibility byte)

CollationCoercibility implements the interface sql.CollationCoercible.

func (*DateSub) Description

func (d *DateSub) Description() string

Description implements sql.FunctionExpression

func (*DateSub) Eval

func (d *DateSub) Eval(ctx *sql.Context, row sql.Row) (interface{}, error)

Eval implements the sql.Expression interface.

func (*DateSub) FunctionName

func (d *DateSub) FunctionName() string

FunctionName implements sql.FunctionExpression

func (*DateSub) IsNullable

func (d *DateSub) IsNullable() bool

IsNullable implements the sql.Expression interface.

func (*DateSub) Resolved

func (d *DateSub) Resolved() bool

Resolved implements the sql.Expression interface.

func (*DateSub) String

func (d *DateSub) String() string

func (*DateSub) Type

func (d *DateSub) Type() sql.Type

Type 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
}

DatetimeConversion is a shorthand function for CONVERT(expr, DATETIME)

func (*DatetimeConversion) Children

func (t *DatetimeConversion) Children() []sql.Expression

func (*DatetimeConversion) CollationCoercibility

func (*DatetimeConversion) CollationCoercibility(ctx *sql.Context) (collation sql.CollationID, coercibility byte)

CollationCoercibility implements the interface sql.CollationCoercible.

func (*DatetimeConversion) Description

func (t *DatetimeConversion) Description() string

Description implements sql.FunctionExpression

func (*DatetimeConversion) Eval

func (t *DatetimeConversion) Eval(ctx *sql.Context, r sql.Row) (interface{}, error)

func (*DatetimeConversion) FunctionName

func (t *DatetimeConversion) FunctionName() string

FunctionName implements sql.FunctionExpression

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) CollationCoercibility

func (*Day) CollationCoercibility(ctx *sql.Context) (collation sql.CollationID, coercibility byte)

CollationCoercibility implements the interface sql.CollationCoercible.

func (*Day) Description

func (d *Day) Description() string

Description implements sql.FunctionExpression

func (*Day) Eval

func (d *Day) Eval(ctx *sql.Context, row sql.Row) (interface{}, error)

Eval implements the Expression interface.

func (*Day) FunctionName

func (d *Day) FunctionName() string

FunctionName implements sql.FunctionExpression

func (*Day) String

func (d *Day) String() string

func (*Day) Type

func (d *Day) Type() sql.Type

Type implements the Expression interface.

func (*Day) WithChildren

func (d *Day) WithChildren(children ...sql.Expression) (sql.Expression, error)

WithChildren implements the Expression interface.

type DayName

type DayName struct {
	*UnaryFunc
}

DayName implements the DAYNAME function

func (*DayName) CollationCoercibility

func (*DayName) CollationCoercibility(ctx *sql.Context) (collation sql.CollationID, coercibility byte)

CollationCoercibility implements the interface sql.CollationCoercible.

func (*DayName) Description

func (d *DayName) Description() string

Description implements sql.FunctionExpression

func (*DayName) Eval

func (d *DayName) Eval(ctx *sql.Context, row sql.Row) (interface{}, error)

func (*DayName) FunctionName

func (d *DayName) FunctionName() string

FunctionName implements sql.FunctionExpression

func (*DayName) WithChildren

func (d *DayName) WithChildren(children ...sql.Expression) (sql.Expression, error)

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) CollationCoercibility

func (*DayOfWeek) CollationCoercibility(ctx *sql.Context) (collation sql.CollationID, coercibility byte)

CollationCoercibility implements the interface sql.CollationCoercible.

func (*DayOfWeek) Description

func (d *DayOfWeek) Description() string

Description implements sql.FunctionExpression

func (*DayOfWeek) Eval

func (d *DayOfWeek) Eval(ctx *sql.Context, row sql.Row) (interface{}, error)

Eval implements the Expression interface.

func (*DayOfWeek) FunctionName

func (d *DayOfWeek) FunctionName() string

FunctionName implements sql.FunctionExpression

func (*DayOfWeek) String

func (d *DayOfWeek) String() string

func (*DayOfWeek) Type

func (d *DayOfWeek) Type() sql.Type

Type implements the Expression interface.

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) CollationCoercibility

func (*DayOfYear) CollationCoercibility(ctx *sql.Context) (collation sql.CollationID, coercibility byte)

CollationCoercibility implements the interface sql.CollationCoercible.

func (*DayOfYear) Description

func (d *DayOfYear) Description() string

Description implements sql.FunctionExpression

func (*DayOfYear) Eval

func (d *DayOfYear) Eval(ctx *sql.Context, row sql.Row) (interface{}, error)

Eval implements the Expression interface.

func (*DayOfYear) FunctionName

func (d *DayOfYear) FunctionName() string

FunctionName implements sql.FunctionExpression

func (*DayOfYear) String

func (d *DayOfYear) String() string

func (*DayOfYear) Type

func (d *DayOfYear) Type() sql.Type

Type implements the Expression interface.

func (*DayOfYear) WithChildren

func (d *DayOfYear) WithChildren(children ...sql.Expression) (sql.Expression, error)

WithChildren implements the Expression interface.

type Degrees

type Degrees struct {
	*UnaryFunc
}

func (*Degrees) CollationCoercibility

func (*Degrees) CollationCoercibility(ctx *sql.Context) (collation sql.CollationID, coercibility byte)

CollationCoercibility implements the interface sql.CollationCoercible.

func (*Degrees) Description

func (d *Degrees) Description() string

Description implements sql.FunctionExpression

func (*Degrees) Eval

func (d *Degrees) Eval(ctx *sql.Context, row sql.Row) (interface{}, error)

Eval implements sql.Expression

func (*Degrees) FunctionName

func (d *Degrees) FunctionName() string

FunctionName implements sql.FunctionExpression

func (*Degrees) WithChildren

func (d *Degrees) WithChildren(children ...sql.Expression) (sql.Expression, error)

WithChildren implements sql.Expression

type Elt

type Elt struct {
	// contains filtered or unexported fields
}

Elt joins several strings together.

func (*Elt) Children

func (e *Elt) Children() []sql.Expression

Children implements the Expression interface.

func (*Elt) CollationCoercibility

func (e *Elt) CollationCoercibility(ctx *sql.Context) (sql.CollationID, byte)

CollationCoercibility implements the interface sql.CollationCoercible.

func (*Elt) Description

func (e *Elt) Description() string

Description implements sql.FunctionExpression

func (*Elt) Eval

func (e *Elt) Eval(ctx *sql.Context, row sql.Row) (interface{}, error)

Eval implements the Expression interface.

func (*Elt) FunctionName

func (e *Elt) FunctionName() string

FunctionName implements sql.FunctionExpression

func (*Elt) IsNullable

func (e *Elt) IsNullable() bool

IsNullable implements the Expression interface.

func (*Elt) Resolved

func (e *Elt) Resolved() bool

Resolved implements the Expression interface.

func (*Elt) String

func (e *Elt) String() string

String implements the Stringer interface.

func (*Elt) Type

func (e *Elt) Type() sql.Type

Type implements the Expression interface.

func (*Elt) WithChildren

func (*Elt) WithChildren(children ...sql.Expression) (sql.Expression, error)

WithChildren implements the Expression interface.

type Exp

type Exp struct {
	*UnaryFunc
}

func (*Exp) CollationCoercibility

func (e *Exp) CollationCoercibility(ctx *sql.Context) (collation sql.CollationID, coercibility byte)

CollationCoercibility implements the interface sql.CollationCoercible.

func (*Exp) Description

func (e *Exp) Description() string

Description implements sql.FunctionExpression

func (*Exp) Eval

func (e *Exp) Eval(ctx *sql.Context, row sql.Row) (interface{}, error)

Eval implements the Expression interface.

func (*Exp) Type

func (e *Exp) Type() sql.Type

Type implements the Expression interface.

func (*Exp) WithChildren

func (e *Exp) WithChildren(children ...sql.Expression) (sql.Expression, error)

WithChildren implements the Expression interface.

type Extract

type Extract struct {
	expression.BinaryExpressionStub
}

Extract takes out the specified unit(s) from the time expression.

func (*Extract) CollationCoercibility

func (*Extract) CollationCoercibility(ctx *sql.Context) (collation sql.CollationID, coercibility byte)

CollationCoercibility implements the interface sql.CollationCoercible.

func (*Extract) Description

func (td *Extract) Description() string

Description implements sql.FunctionExpression

func (*Extract) Eval

func (td *Extract) Eval(ctx *sql.Context, row sql.Row) (interface{}, error)

Eval implements the Expression interface.

func (*Extract) FunctionName

func (td *Extract) FunctionName() string

FunctionName implements sql.FunctionExpression

func (*Extract) String

func (td *Extract) String() string

func (*Extract) Type

func (td *Extract) Type() sql.Type

Type implements the Expression interface.

func (*Extract) WithChildren

func (td *Extract) WithChildren(children ...sql.Expression) (sql.Expression, error)

WithChildren implements the Expression interface.

type Field

type Field struct {
	// contains filtered or unexported fields
}

Field joins several strings together.

func (*Field) Children

func (f *Field) Children() []sql.Expression

Children implements the Expression interface.

func (*Field) CollationCoercibility

func (f *Field) CollationCoercibility(ctx *sql.Context) (sql.CollationID, byte)

CollationCoercibility implements the interface sql.CollationCoercible.

func (*Field) Description

func (f *Field) Description() string

Description implements sql.FunctionExpression

func (*Field) Eval

func (f *Field) Eval(ctx *sql.Context, row sql.Row) (interface{}, error)

Eval implements the Expression interface.

func (*Field) FunctionName

func (f *Field) FunctionName() string

FunctionName implements sql.FunctionExpression

func (*Field) IsNullable

func (f *Field) IsNullable() bool

IsNullable implements the Expression interface.

func (*Field) Resolved

func (f *Field) Resolved() bool

Resolved implements the Expression interface.

func (*Field) String

func (f *Field) String() string

String implements the Stringer interface.

func (*Field) Type

func (f *Field) Type() sql.Type

Type implements the Expression interface.

func (*Field) WithChildren

func (*Field) WithChildren(children ...sql.Expression) (sql.Expression, error)

WithChildren implements the Expression interface.

type FindInSet

type FindInSet struct {
	expression.BinaryExpressionStub
}

FindInSet takes out the specified unit(s) from the time expression.

func (*FindInSet) CollationCoercibility

func (*FindInSet) CollationCoercibility(ctx *sql.Context) (collation sql.CollationID, coercibility byte)

CollationCoercibility implements the interface sql.CollationCoercible.

func (*FindInSet) Description

func (f *FindInSet) Description() string

Description implements sql.FunctionExpression

func (*FindInSet) Eval

func (f *FindInSet) Eval(ctx *sql.Context, row sql.Row) (interface{}, error)

Eval implements the Expression interface.

func (*FindInSet) FunctionName

func (f *FindInSet) FunctionName() string

FunctionName implements sql.FunctionExpression

func (*FindInSet) String

func (f *FindInSet) String() string

func (*FindInSet) Type

func (f *FindInSet) Type() sql.Type

Type implements the Expression interface.

func (*FindInSet) WithChildren

func (f *FindInSet) 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) CollationCoercibility

func (*Floor) CollationCoercibility(ctx *sql.Context) (collation sql.CollationID, coercibility byte)

CollationCoercibility implements the interface sql.CollationCoercible.

func (*Floor) Description

func (f *Floor) Description() string

Description implements sql.FunctionExpression

func (*Floor) Eval

func (f *Floor) Eval(ctx *sql.Context, row sql.Row) (interface{}, error)

Eval implements the Expression interface.

func (*Floor) FunctionName

func (f *Floor) FunctionName() string

FunctionName implements sql.FunctionExpression

func (*Floor) String

func (f *Floor) String() string

func (*Floor) Type

func (f *Floor) Type() sql.Type

Type implements the Expression interface.

func (*Floor) WithChildren

func (f *Floor) WithChildren(children ...sql.Expression) (sql.Expression, error)

WithChildren implements the Expression interface.

type Format

type Format struct {
	NumValue         sql.Expression
	NumDecimalPlaces sql.Expression
	Locale           sql.Expression
}

Format function returns a result of NumValue rounded to NumDecimalPlaces as a string.

func (*Format) Children

func (f *Format) Children() []sql.Expression

Children implements the Expression interface.

func (*Format) CollationCoercibility

func (*Format) CollationCoercibility(ctx *sql.Context) (collation sql.CollationID, coercibility byte)

CollationCoercibility implements the interface sql.CollationCoercible.

func (*Format) Description

func (f *Format) Description() string

Description implements sql.FunctionExpression

func (*Format) Eval

func (f *Format) Eval(ctx *sql.Context, row sql.Row) (interface{}, error)

Eval implements the Expression interface.

func (*Format) FunctionName

func (f *Format) FunctionName() string

FunctionName implements sql.FunctionExpression

func (*Format) IsNullable

func (f *Format) IsNullable() bool

IsNullable implements the Expression interface.

func (*Format) Resolved

func (f *Format) Resolved() bool

Resolved implements the Expression interface.

func (*Format) String

func (f *Format) String() string

func (*Format) Type

func (f *Format) Type() sql.Type

Type implements the Expression interface.

func (*Format) WithChildren

func (f *Format) WithChildren(children ...sql.Expression) (sql.Expression, error)

WithChildren implements the Expression interface.

type FoundRows

type FoundRows struct{}

FoundRows implements the FOUND_ROWS() function

func (FoundRows) Children

func (r FoundRows) Children() []sql.Expression

Children implements sql.Expression

func (FoundRows) CollationCoercibility

func (FoundRows) CollationCoercibility(ctx *sql.Context) (collation sql.CollationID, coercibility byte)

CollationCoercibility implements the interface sql.CollationCoercible.

func (FoundRows) Description

func (r FoundRows) Description() string

Description implements sql.Expression

func (FoundRows) Eval

func (r FoundRows) Eval(ctx *sql.Context, row sql.Row) (interface{}, error)

Eval implements sql.Expression

func (FoundRows) FunctionName

func (r FoundRows) FunctionName() string

FunctionName implements sql.FunctionExpression

func (FoundRows) IsNonDeterministic

func (r FoundRows) IsNonDeterministic() bool

func (FoundRows) IsNullable

func (r FoundRows) IsNullable() bool

IsNullable implements sql.Expression

func (FoundRows) Resolved

func (r FoundRows) Resolved() bool

Resolved implements sql.Expression

func (FoundRows) String

func (r FoundRows) String() string

String implements sql.Expression

func (FoundRows) Type

func (r FoundRows) Type() sql.Type

Type implements sql.Expression

func (FoundRows) WithChildren

func (r FoundRows) WithChildren(children ...sql.Expression) (sql.Expression, error)

WithChildren implements sql.Expression

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) CollationCoercibility

func (*FromBase64) CollationCoercibility(ctx *sql.Context) (collation sql.CollationID, coercibility byte)

CollationCoercibility implements the interface sql.CollationCoercible.

func (*FromBase64) Description

func (t *FromBase64) Description() string

Description implements sql.FunctionExpression

func (*FromBase64) Eval

func (t *FromBase64) Eval(ctx *sql.Context, row sql.Row) (interface{}, error)

Eval implements the Expression interface.

func (*FromBase64) FunctionName

func (t *FromBase64) FunctionName() string

FunctionName implements sql.FunctionExpression

func (*FromBase64) IsNullable

func (t *FromBase64) IsNullable() bool

IsNullable implements the Expression interface.

func (*FromBase64) String

func (t *FromBase64) String() string

String implements the fmt.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 FromUnixtime

type FromUnixtime struct {
	*UnaryFunc
}

FromUnixtime converts the argument to a datetime.

func (*FromUnixtime) CollationCoercibility

func (*FromUnixtime) CollationCoercibility(ctx *sql.Context) (collation sql.CollationID, coercibility byte)

CollationCoercibility implements the interface sql.CollationCoercible.

func (*FromUnixtime) Description

func (r *FromUnixtime) Description() string

Description implements sql.FunctionExpression

func (*FromUnixtime) Eval

func (r *FromUnixtime) Eval(ctx *sql.Context, row sql.Row) (interface{}, error)

func (*FromUnixtime) WithChildren

func (r *FromUnixtime) WithChildren(children ...sql.Expression) (sql.Expression, error)

type GetLock

type GetLock struct {
	expression.BinaryExpressionStub
	// contains filtered or unexported fields
}

GetLock is a SQL function implementing get_lock

func (*GetLock) CollationCoercibility

func (*GetLock) CollationCoercibility(ctx *sql.Context) (collation sql.CollationID, coercibility byte)

CollationCoercibility implements the interface sql.CollationCoercible.

func (*GetLock) Description

func (gl *GetLock) Description() string

Description implements sql.FunctionExpression

func (*GetLock) Eval

func (gl *GetLock) Eval(ctx *sql.Context, row sql.Row) (interface{}, error)

Eval implements the Expression interface.

func (*GetLock) FunctionName

func (gl *GetLock) FunctionName() string

FunctionName implements sql.FunctionExpression

func (*GetLock) IsNullable

func (gl *GetLock) IsNullable() bool

IsNullable implements the Expression interface.

func (*GetLock) String

func (gl *GetLock) String() string

String implements the fmt.Stringer interface.

func (*GetLock) Type

func (gl *GetLock) Type() sql.Type

Type implements the Expression interface.

func (*GetLock) WithChildren

func (gl *GetLock) 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 and 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) Description

func (f *Greatest) Description() string

Description implements sql.FunctionExpression

func (*Greatest) Eval

func (f *Greatest) Eval(ctx *sql.Context, row sql.Row) (interface{}, error)

Eval implements the Expression interface.

func (*Greatest) FunctionName

func (f *Greatest) FunctionName() string

FunctionName implements sql.FunctionExpression

func (*Greatest) IsNullable

func (f *Greatest) IsNullable() bool

IsNullable implements the Expression interface.

func (*Greatest) Resolved

func (f *Greatest) Resolved() bool

Resolved implements the Expression interface.

func (*Greatest) String

func (f *Greatest) String() string

func (*Greatest) Type

func (f *Greatest) Type() sql.Type

Type implements the Expression interface.

func (*Greatest) WithChildren

func (f *Greatest) WithChildren(children ...sql.Expression) (sql.Expression, error)

WithChildren implements the Expression interface.

type Hex

type Hex struct {
	*UnaryFunc
}

Hex implements the sql function "hex" which returns the hexadecimal representation of the string or numeric value

func (*Hex) CollationCoercibility

func (*Hex) CollationCoercibility(ctx *sql.Context) (collation sql.CollationID, coercibility byte)

CollationCoercibility implements the interface sql.CollationCoercible.

func (*Hex) Description

func (h *Hex) Description() string

Description implements sql.FunctionExpression

func (*Hex) Eval

func (h *Hex) Eval(ctx *sql.Context, row sql.Row) (interface{}, error)

Eval implements the sql.Expression interface

func (*Hex) WithChildren

func (h *Hex) WithChildren(children ...sql.Expression) (sql.Expression, error)

WithChildren implements the sql.Expression interface

type Hour

type Hour struct {
	expression.UnaryExpression
}

Hour is a function that returns the hour of a date.

func (*Hour) CollationCoercibility

func (*Hour) CollationCoercibility(ctx *sql.Context) (collation sql.CollationID, coercibility byte)

CollationCoercibility implements the interface sql.CollationCoercible.

func (*Hour) Description

func (h *Hour) Description() string

Description implements sql.FunctionExpression

func (*Hour) Eval

func (h *Hour) Eval(ctx *sql.Context, row sql.Row) (interface{}, error)

Eval implements the Expression interface.

func (*Hour) FunctionName

func (h *Hour) FunctionName() string

FunctionName implements sql.FunctionExpression

func (*Hour) String

func (h *Hour) String() string

func (*Hour) Type

func (h *Hour) Type() sql.Type

Type implements the Expression interface.

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) CollationCoercibility

func (f *If) CollationCoercibility(ctx *sql.Context) (collation sql.CollationID, coercibility byte)

CollationCoercibility implements the interface sql.CollationCoercible.

func (*If) Description

func (f *If) Description() string

Description implements sql.FunctionExpression

func (*If) Eval

func (f *If) Eval(ctx *sql.Context, row sql.Row) (interface{}, error)

Eval implements the Expression interface.

func (*If) FunctionName

func (f *If) FunctionName() string

FunctionName implements sql.FunctionExpression

func (*If) IsNullable

func (f *If) IsNullable() bool

IsNullable implements the Expression interface.

func (*If) Resolved

func (f *If) Resolved() bool

func (*If) String

func (f *If) String() string

func (*If) Type

func (f *If) Type() sql.Type

Type 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.BinaryExpressionStub
}

IfNull function returns the specified value IF the expression is NULL, otherwise return the expression.

func (*IfNull) CollationCoercibility

func (f *IfNull) CollationCoercibility(ctx *sql.Context) (collation sql.CollationID, coercibility byte)

CollationCoercibility implements the interface sql.CollationCoercible.

func (*IfNull) Description

func (f *IfNull) Description() string

Description implements sql.FunctionExpression

func (*IfNull) Eval

func (f *IfNull) Eval(ctx *sql.Context, row sql.Row) (interface{}, error)

Eval implements the Expression interface.

func (*IfNull) FunctionName

func (f *IfNull) FunctionName() string

FunctionName implements sql.FunctionExpression

func (*IfNull) IsNullable

func (f *IfNull) IsNullable() bool

IsNullable implements the Expression interface.

func (*IfNull) String

func (f *IfNull) String() string

func (*IfNull) Type

func (f *IfNull) Type() sql.Type

Type implements the Expression interface.

func (*IfNull) WithChildren

func (f *IfNull) WithChildren(children ...sql.Expression) (sql.Expression, error)

WithChildren implements the Expression interface.

type Inet6Aton

type Inet6Aton struct {
	expression.UnaryExpression
}

func (*Inet6Aton) CollationCoercibility

func (*Inet6Aton) CollationCoercibility(ctx *sql.Context) (collation sql.CollationID, coercibility byte)

CollationCoercibility implements the interface sql.CollationCoercible.

func (*Inet6Aton) Description

func (i *Inet6Aton) Description() string

Description implements sql.FunctionExpression

func (*Inet6Aton) Eval

func (i *Inet6Aton) Eval(ctx *sql.Context, row sql.Row) (interface{}, error)

func (*Inet6Aton) FunctionName

func (i *Inet6Aton) FunctionName() string

FunctionName implements sql.FunctionExpression

func (*Inet6Aton) String

func (i *Inet6Aton) String() string

func (*Inet6Aton) Type

func (i *Inet6Aton) Type() sql.Type

func (*Inet6Aton) WithChildren

func (i *Inet6Aton) WithChildren(children ...sql.Expression) (sql.Expression, error)

type Inet6Ntoa

type Inet6Ntoa struct {
	expression.UnaryExpression
}

func (*Inet6Ntoa) CollationCoercibility

func (*Inet6Ntoa) CollationCoercibility(ctx *sql.Context) (collation sql.CollationID, coercibility byte)

CollationCoercibility implements the interface sql.CollationCoercible.

func (*Inet6Ntoa) Description

func (i *Inet6Ntoa) Description() string

Description implements sql.FunctionExpression

func (*Inet6Ntoa) Eval

func (i *Inet6Ntoa) Eval(ctx *sql.Context, row sql.Row) (interface{}, error)

func (*Inet6Ntoa) FunctionName

func (i *Inet6Ntoa) FunctionName() string

FunctionName implements sql.FunctionExpression

func (*Inet6Ntoa) String

func (i *Inet6Ntoa) String() string

func (*Inet6Ntoa) Type

func (i *Inet6Ntoa) Type() sql.Type

func (*Inet6Ntoa) WithChildren

func (i *Inet6Ntoa) WithChildren(children ...sql.Expression) (sql.Expression, error)

type InetAton

type InetAton struct {
	expression.UnaryExpression
}

func (*InetAton) CollationCoercibility

func (*InetAton) CollationCoercibility(ctx *sql.Context) (collation sql.CollationID, coercibility byte)

CollationCoercibility implements the interface sql.CollationCoercible.

func (*InetAton) Description

func (i *InetAton) Description() string

Description implements sql.FunctionExpression

func (*InetAton) Eval

func (i *InetAton) Eval(ctx *sql.Context, row sql.Row) (interface{}, error)

func (*InetAton) FunctionName

func (i *InetAton) FunctionName() string

FunctionName implements sql.FunctionExpression

func (*InetAton) String

func (i *InetAton) String() string

func (*InetAton) Type

func (i *InetAton) Type() sql.Type

func (*InetAton) WithChildren

func (i *InetAton) WithChildren(children ...sql.Expression) (sql.Expression, error)

type InetNtoa

type InetNtoa struct {
	expression.UnaryExpression
}

func (*InetNtoa) CollationCoercibility

func (*InetNtoa) CollationCoercibility(ctx *sql.Context) (collation sql.CollationID, coercibility byte)

CollationCoercibility implements the interface sql.CollationCoercible.

func (*InetNtoa) Description

func (i *InetNtoa) Description() string

Description implements sql.FunctionExpression

func (*InetNtoa) Eval

func (i *InetNtoa) Eval(ctx *sql.Context, row sql.Row) (interface{}, error)

func (*InetNtoa) FunctionName

func (i *InetNtoa) FunctionName() string

FunctionName implements sql.FunctionExpression

func (*InetNtoa) String

func (i *InetNtoa) String() string

func (*InetNtoa) Type

func (i *InetNtoa) Type() sql.Type

func (*InetNtoa) WithChildren

func (i *InetNtoa) WithChildren(children ...sql.Expression) (sql.Expression, error)

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) CollationCoercibility

func (Instr) CollationCoercibility(ctx *sql.Context) (collation sql.CollationID, coercibility byte)

CollationCoercibility implements the interface sql.CollationCoercible.

func (Instr) Description

func (i Instr) Description() string

Description implements sql.FunctionExpression

func (Instr) Eval

func (i Instr) Eval(ctx *sql.Context, row sql.Row) (interface{}, error)

Eval implements the Expression interface.

func (Instr) FunctionName

func (i Instr) FunctionName() string

FunctionName implements sql.FunctionExpression

func (Instr) IsNullable

func (i Instr) IsNullable() bool

IsNullable implements the Expression interface.

func (Instr) Resolved

func (i Instr) Resolved() bool

Resolved implements the Expression interface.

func (Instr) String

func (i Instr) String() string

func (Instr) Type

func (Instr) Type() sql.Type

Type 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) CollationCoercibility

func (*IsBinary) CollationCoercibility(ctx *sql.Context) (collation sql.CollationID, coercibility byte)

CollationCoercibility implements the interface sql.CollationCoercible.

func (*IsBinary) Description

func (ib *IsBinary) Description() string

Description implements sql.FunctionExpression

func (*IsBinary) Eval

func (ib *IsBinary) Eval(
	ctx *sql.Context,
	row sql.Row,
) (interface{}, error)

Eval implements the Expression interface.

func (*IsBinary) FunctionName

func (ib *IsBinary) FunctionName() string

FunctionName implements sql.FunctionExpression

func (*IsBinary) String

func (ib *IsBinary) String() string

func (*IsBinary) Type

func (ib *IsBinary) Type() sql.Type

Type implements the Expression interface.

func (*IsBinary) WithChildren

func (ib *IsBinary) WithChildren(children ...sql.Expression) (sql.Expression, error)

WithChildren implements the Expression interface.

type IsFreeLock

type IsFreeLock struct {
	NamedLockFunction
}

func (*IsFreeLock) CollationCoercibility

func (*IsFreeLock) CollationCoercibility(ctx *sql.Context) (collation sql.CollationID, coercibility byte)

CollationCoercibility implements the interface sql.CollationCoercible.

func (*IsFreeLock) Description

func (i *IsFreeLock) Description() string

Description implements sql.FunctionExpression

func (*IsFreeLock) Eval

func (i *IsFreeLock) Eval(ctx *sql.Context, row sql.Row) (interface{}, error)

func (*IsFreeLock) WithChildren

func (i *IsFreeLock) WithChildren(children ...sql.Expression) (sql.Expression, error)

type IsIPv4

type IsIPv4 struct {
	expression.UnaryExpression
}

func (*IsIPv4) CollationCoercibility

func (*IsIPv4) CollationCoercibility(ctx *sql.Context) (collation sql.CollationID, coercibility byte)

CollationCoercibility implements the interface sql.CollationCoercible.

func (*IsIPv4) Description

func (i *IsIPv4) Description() string

Description implements sql.FunctionExpression

func (*IsIPv4) Eval

func (i *IsIPv4) Eval(ctx *sql.Context, row sql.Row) (interface{}, error)

Eval implements the Expression interface

func (*IsIPv4) FunctionName

func (i *IsIPv4) FunctionName() string

FunctionName implements sql.FunctionExpression

func (*IsIPv4) String

func (i *IsIPv4) String() string

func (*IsIPv4) Type

func (i *IsIPv4) Type() sql.Type

func (*IsIPv4) WithChildren

func (i *IsIPv4) WithChildren(children ...sql.Expression) (sql.Expression, error)

type IsIPv4Compat

type IsIPv4Compat struct {
	expression.UnaryExpression
}

func (*IsIPv4Compat) CollationCoercibility

func (*IsIPv4Compat) CollationCoercibility(ctx *sql.Context) (collation sql.CollationID, coercibility byte)

CollationCoercibility implements the interface sql.CollationCoercible.

func (*IsIPv4Compat) Description

func (i *IsIPv4Compat) Description() string

Description implements sql.FunctionExpression

func (*IsIPv4Compat) Eval

func (i *IsIPv4Compat) Eval(ctx *sql.Context, row sql.Row) (interface{}, error)

Eval implements the Expression interface

func (*IsIPv4Compat) FunctionName

func (i *IsIPv4Compat) FunctionName() string

FunctionName implements sql.FunctionExpression

func (*IsIPv4Compat) String

func (i *IsIPv4Compat) String() string

func (*IsIPv4Compat) Type

func (i *IsIPv4Compat) Type() sql.Type

func (*IsIPv4Compat) WithChildren

func (i *IsIPv4Compat) WithChildren(children ...sql.Expression) (sql.Expression, error)

type IsIPv4Mapped

type IsIPv4Mapped struct {
	expression.UnaryExpression
}

func (*IsIPv4Mapped) CollationCoercibility

func (*IsIPv4Mapped) CollationCoercibility(ctx *sql.Context) (collation sql.CollationID, coercibility byte)

CollationCoercibility implements the interface sql.CollationCoercible.

func (*IsIPv4Mapped) Description

func (i *IsIPv4Mapped) Description() string

Description implements sql.FunctionExpression

func (*IsIPv4Mapped) Eval

func (i *IsIPv4Mapped) Eval(ctx *sql.Context, row sql.Row) (interface{}, error)

Eval implements the Expression interface

func (*IsIPv4Mapped) FunctionName

func (i *IsIPv4Mapped) FunctionName() string

FunctionName implements sql.FunctionExpression

func (*IsIPv4Mapped) String

func (i *IsIPv4Mapped) String() string

func (*IsIPv4Mapped) Type

func (i *IsIPv4Mapped) Type() sql.Type

func (*IsIPv4Mapped) WithChildren

func (i *IsIPv4Mapped) WithChildren(children ...sql.Expression) (sql.Expression, error)

type IsIPv6

type IsIPv6 struct {
	expression.UnaryExpression
}

func (*IsIPv6) CollationCoercibility

func (*IsIPv6) CollationCoercibility(ctx *sql.Context) (collation sql.CollationID, coercibility byte)

CollationCoercibility implements the interface sql.CollationCoercible.

func (*IsIPv6) Description

func (i *IsIPv6) Description() string

Description implements sql.FunctionExpression

func (*IsIPv6) Eval

func (i *IsIPv6) Eval(ctx *sql.Context, row sql.Row) (interface{}, error)

Eval implements the Expression interface

func (*IsIPv6) FunctionName

func (i *IsIPv6) FunctionName() string

FunctionName implements sql.FunctionExpression

func (*IsIPv6) String

func (i *IsIPv6) String() string

func (*IsIPv6) Type

func (i *IsIPv6) Type() sql.Type

func (*IsIPv6) WithChildren

func (i *IsIPv6) WithChildren(children ...sql.Expression) (sql.Expression, error)

type IsNull

type IsNull struct {
	expression.UnaryExpression
}

IsNull is a function that returns whether a value is null or not.

func (*IsNull) CollationCoercibility

func (*IsNull) CollationCoercibility(ctx *sql.Context) (collation sql.CollationID, coercibility byte)

CollationCoercibility implements the interface sql.CollationCoercible.

func (*IsNull) Description

func (ib *IsNull) Description() string

Description implements sql.FunctionExpression

func (*IsNull) Eval

func (ib *IsNull) Eval(ctx *sql.Context, row sql.Row) (interface{}, error)

Eval implements the Expression interface.

func (*IsNull) FunctionName

func (ib *IsNull) FunctionName() string

FunctionName implements sql.FunctionExpression

func (*IsNull) String

func (ib *IsNull) String() string

func (*IsNull) Type

func (ib *IsNull) Type() sql.Type

Type implements the Expression interface.

func (*IsNull) WithChildren

func (ib *IsNull) WithChildren(children ...sql.Expression) (sql.Expression, error)

WithChildren implements the Expression interface.

type IsUUID

type IsUUID struct {
	// contains filtered or unexported fields
}

func (IsUUID) Children

func (u IsUUID) Children() []sql.Expression

Children returns the children expressions of this expression.

func (IsUUID) CollationCoercibility

func (IsUUID) CollationCoercibility(ctx *sql.Context) (collation sql.CollationID, coercibility byte)

CollationCoercibility implements the interface sql.CollationCoercible.

func (IsUUID) Description

func (u IsUUID) Description() string

Description implements sql.FunctionExpression

func (IsUUID) Eval

func (u IsUUID) Eval(ctx *sql.Context, row sql.Row) (interface{}, error)

func (IsUUID) FunctionName

func (u IsUUID) FunctionName() string

FunctionName implements sql.FunctionExpression

func (IsUUID) IsNullable

func (u IsUUID) IsNullable() bool

IsNullable returns whether the expression can be null.

func (IsUUID) Resolved

func (u IsUUID) Resolved() bool

func (IsUUID) String

func (u IsUUID) String() string

func (IsUUID) Type

func (u IsUUID) Type() sql.Type

func (IsUUID) WithChildren

func (u IsUUID) WithChildren(children ...sql.Expression) (sql.Expression, error)

type IsUsedLock

type IsUsedLock struct {
	NamedLockFunction
}

func (*IsUsedLock) CollationCoercibility

func (*IsUsedLock) CollationCoercibility(ctx *sql.Context) (collation sql.CollationID, coercibility byte)

CollationCoercibility implements the interface sql.CollationCoercible.

func (*IsUsedLock) Description

func (i *IsUsedLock) Description() string

Description implements sql.FunctionExpression

func (*IsUsedLock) Eval

func (i *IsUsedLock) Eval(ctx *sql.Context, row sql.Row) (interface{}, error)

func (*IsUsedLock) WithChildren

func (i *IsUsedLock) WithChildren(children ...sql.Expression) (sql.Expression, error)

type LastInsertId

type LastInsertId struct {
	expression.UnaryExpression
}

LastInsertId implements the LAST_INSERT_ID() function https://dev.mysql.com/doc/refman/8.0/en/information-functions.html#function_last-insert-id

func (LastInsertId) Children

func (r LastInsertId) Children() []sql.Expression

Children implements sql.Expression

func (LastInsertId) CollationCoercibility

func (LastInsertId) CollationCoercibility(ctx *sql.Context) (collation sql.CollationID, coercibility byte)

CollationCoercibility implements the interface sql.CollationCoercible.

func (LastInsertId) Description

func (r LastInsertId) Description() string

Description implements sql.FunctionExpression

func (LastInsertId) Eval

func (r LastInsertId) Eval(ctx *sql.Context, row sql.Row) (interface{}, error)

Eval implements sql.Expression

func (LastInsertId) FunctionName

func (r LastInsertId) FunctionName() string

FunctionName implements sql.FunctionExpression

func (LastInsertId) IsNonDeterministic

func (r LastInsertId) IsNonDeterministic() bool

func (LastInsertId) IsNullable

func (r LastInsertId) IsNullable() bool

IsNullable implements sql.Expression

func (LastInsertId) Resolved

func (r LastInsertId) Resolved() bool

Resolved implements sql.Expression

func (LastInsertId) String

func (r LastInsertId) String() string

String implements sql.Expression

func (LastInsertId) Type

func (r LastInsertId) Type() sql.Type

Type implements sql.Expression

func (LastInsertId) WithChildren

func (r LastInsertId) WithChildren(children ...sql.Expression) (sql.Expression, error)

WithChildren implements sql.Expression

type LastInsertUuid

type LastInsertUuid struct{}

LastInsertUuid implements the LAST_INSERT_UUID() function. This function is NOT a standard function in MySQL, but is a useful analogue to LAST_INSERT_ID() if customers are inserting UUIDs into a table.

func (LastInsertUuid) Children

func (l LastInsertUuid) Children() []sql.Expression

func (LastInsertUuid) CollationCoercibility

func (l LastInsertUuid) CollationCoercibility(_ *sql.Context) (collation sql.CollationID, coercibility byte)

func (LastInsertUuid) Description

func (l LastInsertUuid) Description() string

func (LastInsertUuid) Eval

func (l LastInsertUuid) Eval(ctx *sql.Context, _ sql.Row) (interface{}, error)

func (LastInsertUuid) FunctionName

func (l LastInsertUuid) FunctionName() string

func (LastInsertUuid) IsNullable

func (l LastInsertUuid) IsNullable() bool

func (LastInsertUuid) Resolved

func (l LastInsertUuid) Resolved() bool

func (LastInsertUuid) String

func (l LastInsertUuid) String() string

func (LastInsertUuid) Type

func (l LastInsertUuid) Type() sql.Type

func (LastInsertUuid) WithChildren

func (l LastInsertUuid) WithChildren(children ...sql.Expression) (sql.Expression, error)

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) Description

func (f *Least) Description() string

Description implements sql.FunctionExpression

func (*Least) Eval

func (f *Least) Eval(ctx *sql.Context, row sql.Row) (interface{}, error)

Eval implements the Expression interface.

func (*Least) FunctionName

func (f *Least) FunctionName() string

FunctionName implements sql.FunctionExpression

func (*Least) IsNullable

func (f *Least) IsNullable() bool

IsNullable implements the Expression interface.

func (*Least) Resolved

func (f *Least) Resolved() bool

Resolved implements the Expression interface.

func (*Least) String

func (f *Least) String() string

func (*Least) Type

func (f *Least) Type() sql.Type

Type 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) CollationCoercibility

func (l Left) CollationCoercibility(ctx *sql.Context) (collation sql.CollationID, coercibility byte)

CollationCoercibility implements the interface sql.CollationCoercible.

func (Left) Description

func (l Left) Description() string

Description implements sql.FunctionExpression

func (Left) Eval

func (l Left) Eval(ctx *sql.Context, row sql.Row) (interface{}, error)

Eval implements the Expression interface.

func (Left) FunctionName

func (l Left) FunctionName() string

FunctionName implements sql.FunctionExpression

func (Left) IsNullable

func (l Left) IsNullable() bool

IsNullable implements the Expression interface.

func (Left) Resolved

func (l Left) Resolved() bool

Resolved implements the Expression interface.

func (Left) String

func (l Left) String() string

func (Left) Type

func (Left) Type() sql.Type

Type implements the Expression interface.

func (Left) WithChildren

func (l Left) WithChildren(children ...sql.Expression) (sql.Expression, error)

WithChildren implements the Expression interface.

type LeftTrim

type LeftTrim struct {
	expression.UnaryExpression
}

func (*LeftTrim) CollationCoercibility

func (t *LeftTrim) CollationCoercibility(ctx *sql.Context) (collation sql.CollationID, coercibility byte)

CollationCoercibility implements the interface sql.CollationCoercible.

func (*LeftTrim) Description

func (t *LeftTrim) Description() string

Description implements sql.FunctionExpression

func (*LeftTrim) Eval

func (t *LeftTrim) Eval(ctx *sql.Context, row sql.Row) (interface{}, error)

func (*LeftTrim) FunctionName

func (t *LeftTrim) FunctionName() string

FunctionName implements sql.FunctionExpression

func (*LeftTrim) IsNullable

func (t *LeftTrim) IsNullable() bool

func (*LeftTrim) String

func (t *LeftTrim) String() string

func (*LeftTrim) Type

func (t *LeftTrim) Type() sql.Type

func (*LeftTrim) WithChildren

func (t *LeftTrim) WithChildren(children ...sql.Expression) (sql.Expression, error)

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) CollationCoercibility

func (*Length) CollationCoercibility(ctx *sql.Context) (collation sql.CollationID, coercibility byte)

CollationCoercibility implements the interface sql.CollationCoercible.

func (*Length) DebugString

func (l *Length) DebugString() string

func (*Length) Description

func (l *Length) Description() string

Description implements sql.FunctionExpression

func (*Length) Eval

func (l *Length) Eval(ctx *sql.Context, row sql.Row) (interface{}, error)

Eval implements the sql.Expression interface.

func (*Length) FunctionName

func (l *Length) FunctionName() string

FunctionName implements sql.FunctionExpression

func (*Length) String

func (l *Length) String() string

func (*Length) Type

func (l *Length) Type() sql.Type

Type implements the sql.Expression interface.

func (*Length) WithChildren

func (l *Length) WithChildren(children ...sql.Expression) (sql.Expression, error)

WithChildren implements the Expression interface.

type LoadFile

type LoadFile struct {
	// contains filtered or unexported fields
}

func (*LoadFile) Children

func (l *LoadFile) Children() []sql.Expression

Children implements sql.Expression.

func (*LoadFile) CollationCoercibility

func (*LoadFile) CollationCoercibility(ctx *sql.Context) (collation sql.CollationID, coercibility byte)

CollationCoercibility implements the interface sql.CollationCoercible.

func (*LoadFile) Description

func (l *LoadFile) Description() string

Description implements sql.FunctionExpression

func (*LoadFile) Eval

func (l *LoadFile) Eval(ctx *sql.Context, row sql.Row) (interface{}, error)

TODO: Allow FILE privileges for GRANT Eval implements sql.Expression.

func (*LoadFile) FunctionName

func (l *LoadFile) FunctionName() string

FunctionName implements sql.FunctionExpression.

func (*LoadFile) IsNullable

func (l *LoadFile) IsNullable() bool

IsNullable implements sql.Expression.

func (*LoadFile) Resolved

func (l *LoadFile) Resolved() bool

Resolved implements sql.Expression.

func (*LoadFile) String

func (l *LoadFile) String() string

String implements sql.Expression.

func (*LoadFile) Type

func (l *LoadFile) Type() sql.Type

Type implements sql.Expression.

func (*LoadFile) WithChildren

func (l *LoadFile) WithChildren(children ...sql.Expression) (sql.Expression, error)

WithChildren implements sql.Expression.

type Locate

type Locate struct {
	expression.NaryExpression
}

Locate returns the position of the first occurrence of a substring in a string. If the substring is not found within the original string, this function returns 0. This function performs a case-insensitive search.

func (*Locate) CollationCoercibility

func (*Locate) CollationCoercibility(ctx *sql.Context) (collation sql.CollationID, coercibility byte)

CollationCoercibility implements the interface sql.CollationCoercible.

func (*Locate) DebugString

func (l *Locate) DebugString() string

func (*Locate) Description

func (l *Locate) Description() string

Description implements sql.FunctionExpression

func (*Locate) Eval

func (l *Locate) Eval(ctx *sql.Context, row sql.Row) (interface{}, error)

Eval implements the sql.Expression interface.

func (*Locate) FunctionName

func (l *Locate) FunctionName() string

FunctionName implements sql.FunctionExpression

func (*Locate) String

func (l *Locate) String() string

func (*Locate) Type

func (l *Locate) Type() sql.Type

Type implements the sql.Expression interface.

func (*Locate) WithChildren

func (l *Locate) WithChildren(children ...sql.Expression) (sql.Expression, error)

WithChildren implements the Expression interface.

type Log

type Log struct {
	expression.BinaryExpressionStub
}

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) CollationCoercibility

func (*Log) CollationCoercibility(ctx *sql.Context) (collation sql.CollationID, coercibility byte)

CollationCoercibility implements the interface sql.CollationCoercible.

func (*Log) Description

func (l *Log) Description() string

Description implements sql.FunctionExpression

func (*Log) Eval

func (l *Log) Eval(
	ctx *sql.Context,
	row sql.Row,
) (interface{}, error)

Eval implements the Expression interface.

func (*Log) FunctionName

func (l *Log) FunctionName() string

FunctionName implements sql.FunctionExpression

func (*Log) IsNullable

func (l *Log) IsNullable() bool

IsNullable implements the Expression interface.

func (*Log) String

func (l *Log) String() string

func (*Log) Type

func (l *Log) Type() sql.Type

Type returns the resultant type of the function.

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) CollationCoercibility

func (*LogBase) CollationCoercibility(ctx *sql.Context) (collation sql.CollationID, coercibility byte)

CollationCoercibility implements the interface sql.CollationCoercible.

func (*LogBase) Description

func (l *LogBase) Description() string

Description implements sql.FunctionExpression

func (*LogBase) Eval

func (l *LogBase) Eval(
	ctx *sql.Context,
	row sql.Row,
) (interface{}, error)

Eval implements the Expression interface.

func (*LogBase) FunctionName

func (l *LogBase) FunctionName() string

FunctionName implements sql.FunctionExpression

func (*LogBase) IsNullable

func (l *LogBase) IsNullable() bool

IsNullable implements the sql.Expression interface.

func (*LogBase) String

func (l *LogBase) String() string

func (*LogBase) Type

func (l *LogBase) Type() sql.Type

Type returns the resultant type of the function.

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) CollationCoercibility

func (l *Lower) CollationCoercibility(ctx *sql.Context) (collation sql.CollationID, coercibility byte)

CollationCoercibility implements the interface sql.CollationCoercible.

func (*Lower) Description

func (l *Lower) Description() string

Description implements sql.FunctionExpression

func (*Lower) Eval

func (l *Lower) Eval(
	ctx *sql.Context,
	row sql.Row,
) (interface{}, error)

Eval implements the Expression interface.

func (*Lower) FunctionName

func (l *Lower) FunctionName() string

FunctionName implements sql.FunctionExpression

func (*Lower) String

func (l *Lower) String() string

func (*Lower) Type

func (l *Lower) Type() sql.Type

Type implements the Expression interface.

func (*Lower) WithChildren

func (l *Lower) WithChildren(children ...sql.Expression) (sql.Expression, error)

WithChildren implements the Expression interface.

type MD5

type MD5 struct {
	*UnaryFunc
}

MD5 function returns the MD5 hash of the input. https://dev.mysql.com/doc/refman/8.0/en/encryption-functions.html#function_md5

func (*MD5) CollationCoercibility

func (*MD5) CollationCoercibility(ctx *sql.Context) (collation sql.CollationID, coercibility byte)

CollationCoercibility implements the interface sql.CollationCoercible.

func (*MD5) Description

func (f *MD5) Description() string

Description implements sql.FunctionExpression

func (*MD5) Eval

func (f *MD5) Eval(ctx *sql.Context, row sql.Row) (interface{}, error)

Eval implements sql.Expression

func (*MD5) WithChildren

func (f *MD5) WithChildren(children ...sql.Expression) (sql.Expression, error)

WithChildren implements sql.Expression

type Microsecond

type Microsecond struct {
	*UnaryDatetimeFunc
}

Microsecond implements the MICROSECOND function

func (*Microsecond) CollationCoercibility

func (*Microsecond) CollationCoercibility(ctx *sql.Context) (collation sql.CollationID, coercibility byte)

CollationCoercibility implements the interface sql.CollationCoercible.

func (*Microsecond) Description

func (m *Microsecond) Description() string

Description implements sql.FunctionExpression

func (*Microsecond) Eval

func (m *Microsecond) Eval(ctx *sql.Context, row sql.Row) (interface{}, error)

func (*Microsecond) WithChildren

func (m *Microsecond) WithChildren(children ...sql.Expression) (sql.Expression, error)

type Minute

type Minute struct {
	expression.UnaryExpression
}

Minute is a function that returns the minute of a date.

func (*Minute) CollationCoercibility

func (*Minute) CollationCoercibility(ctx *sql.Context) (collation sql.CollationID, coercibility byte)

CollationCoercibility implements the interface sql.CollationCoercible.

func (*Minute) Description

func (m *Minute) Description() string

Description implements sql.FunctionExpression

func (*Minute) Eval

func (m *Minute) Eval(ctx *sql.Context, row sql.Row) (interface{}, error)

Eval implements the Expression interface.

func (*Minute) FunctionName

func (m *Minute) FunctionName() string

FunctionName implements sql.FunctionExpression

func (*Minute) String

func (m *Minute) String() string

func (*Minute) Type

func (m *Minute) Type() sql.Type

Type implements the Expression interface.

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) CollationCoercibility

func (*Month) CollationCoercibility(ctx *sql.Context) (collation sql.CollationID, coercibility byte)

CollationCoercibility implements the interface sql.CollationCoercible.

func (*Month) Description

func (m *Month) Description() string

Description implements sql.FunctionExpression

func (*Month) Eval

func (m *Month) Eval(ctx *sql.Context, row sql.Row) (interface{}, error)

Eval implements the Expression interface.

func (*Month) FunctionName

func (m *Month) FunctionName() string

FunctionName implements sql.FunctionExpression

func (*Month) String

func (m *Month) String() string

func (*Month) Type

func (m *Month) Type() sql.Type

Type implements the Expression interface.

func (*Month) WithChildren

func (m *Month) WithChildren(children ...sql.Expression) (sql.Expression, error)

WithChildren implements the Expression interface.

type MonthName

type MonthName struct {
	*UnaryDatetimeFunc
}

MonthName implements the MONTHNAME function

func (*MonthName) CollationCoercibility

func (*MonthName) CollationCoercibility(ctx *sql.Context) (collation sql.CollationID, coercibility byte)

CollationCoercibility implements the interface sql.CollationCoercible.

func (*MonthName) Description

func (d *MonthName) Description() string

Description implements sql.FunctionExpression

func (*MonthName) Eval

func (d *MonthName) Eval(ctx *sql.Context, row sql.Row) (interface{}, error)

func (*MonthName) WithChildren

func (d *MonthName) WithChildren(children ...sql.Expression) (sql.Expression, error)

type NamedLockFunction

type NamedLockFunction struct {
	expression.UnaryExpression
	// contains filtered or unexported fields
}

NamedLockFunction is a sql function that takes just the name of a lock as an argument

func (*NamedLockFunction) FunctionName

func (nl *NamedLockFunction) FunctionName() string

FunctionName implements sql.FunctionExpression

func (*NamedLockFunction) GetLockName

func (nl *NamedLockFunction) GetLockName(ctx *sql.Context, row sql.Row) (*string, error)

Eval implements the Expression interface.

func (*NamedLockFunction) IsNullable

func (nl *NamedLockFunction) IsNullable() bool

IsNullable implements the Expression interface.

func (*NamedLockFunction) String

func (nl *NamedLockFunction) String() string

String implements the fmt.Stringer interface.

func (*NamedLockFunction) Type

func (nl *NamedLockFunction) Type() sql.Type

Type implements the Expression interface.

type NoArgFunc

type NoArgFunc struct {
	Name    string
	SQLType sql.Type
}

NoArgFunc is a helper type to reduce boilerplate in functions that take no arguments. Implements most of sql.FunctionExpression.

func (NoArgFunc) Children

func (fn NoArgFunc) Children() []sql.Expression

Children implements the Expression interface.

func (NoArgFunc) FunctionName

func (fn NoArgFunc) FunctionName() string

FunctionName implements sql.FunctionExpression

func (NoArgFunc) IsNullable

func (fn NoArgFunc) IsNullable() bool

IsNullable implements the Expression interface.

func (NoArgFunc) Resolved

func (fn NoArgFunc) Resolved() bool

Resolved implements the Expression interface.

func (NoArgFunc) String

func (fn NoArgFunc) String() string

func (NoArgFunc) Type

func (fn NoArgFunc) Type() sql.Type

Type 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 (n *Now) Children() []sql.Expression

Children implements the sql.Expression interface.

func (*Now) CollationCoercibility

func (*Now) CollationCoercibility(ctx *sql.Context) (collation sql.CollationID, coercibility byte)

CollationCoercibility implements the interface sql.CollationCoercible.

func (*Now) Description

func (n *Now) Description() string

Description implements sql.FunctionExpression

func (*Now) Eval

func (n *Now) Eval(ctx *sql.Context, row sql.Row) (interface{}, error)

Eval implements the sql.Expression interface.

func (*Now) FunctionName

func (n *Now) FunctionName() string

FunctionName implements sql.FunctionExpression

func (*Now) IsNonDeterministic

func (n *Now) IsNonDeterministic() bool

func (*Now) IsNullable

func (n *Now) IsNullable() bool

IsNullable implements the sql.Expression interface.

func (*Now) Resolved

func (n *Now) Resolved() bool

Resolved implements the sql.Expression interface.

func (*Now) String

func (n *Now) String() string

String implements the sql.Expression interface.

func (*Now) Type

func (n *Now) Type() sql.Type

Type 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.BinaryExpressionStub
}

NullIf function compares two expressions and returns NULL if they are equal. Otherwise, the first expression is returned.

func (*NullIf) CollationCoercibility

func (f *NullIf) CollationCoercibility(ctx *sql.Context) (collation sql.CollationID, coercibility byte)

CollationCoercibility implements the interface sql.CollationCoercible.

func (*NullIf) Description

func (f *NullIf) Description() string

Description implements sql.FunctionExpression

func (*NullIf) Eval

func (f *NullIf) Eval(ctx *sql.Context, row sql.Row) (interface{}, error)

Eval implements the Expression interface.

func (*NullIf) FunctionName

func (f *NullIf) FunctionName() string

FunctionName implements sql.FunctionExpression

func (*NullIf) IsNullable

func (f *NullIf) IsNullable() bool

IsNullable implements the Expression interface.

func (*NullIf) String

func (f *NullIf) String() string

func (*NullIf) Type

func (f *NullIf) Type() sql.Type

Type implements the Expression interface.

func (*NullIf) WithChildren

func (f *NullIf) WithChildren(children ...sql.Expression) (sql.Expression, error)

WithChildren implements the Expression interface.

type Ord

type Ord struct {
	*UnaryFunc
}

Ord implements the sql function "ord" which returns the numeric value of the leftmost character

func (*Ord) CollationCoercibility

func (o *Ord) CollationCoercibility(ctx *sql.Context) (collation sql.CollationID, coercibility byte)

CollationCoercibility implements the interface sql.CollationCoercible.

func (*Ord) Description

func (o *Ord) Description() string

Description implements sql.FunctionExpression

func (*Ord) Eval

func (o *Ord) Eval(ctx *sql.Context, row sql.Row) (interface{}, error)

Eval implements the sql.Expression interface

func (*Ord) WithChildren

func (o *Ord) WithChildren(children ...sql.Expression) (sql.Expression, error)

WithChildren implements the sql.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) CollationCoercibility

func (p *Pad) CollationCoercibility(ctx *sql.Context) (collation sql.CollationID, coercibility byte)

CollationCoercibility implements the interface sql.CollationCoercible.

func (*Pad) Description

func (p *Pad) Description() string

Description implements sql.FunctionExpression

func (*Pad) Eval

func (p *Pad) Eval(
	ctx *sql.Context,
	row sql.Row,
) (interface{}, error)

Eval implements the Expression interface.

func (*Pad) FunctionName

func (p *Pad) FunctionName() string

FunctionName implements sql.FunctionExpression

func (*Pad) IsNullable

func (p *Pad) IsNullable() bool

IsNullable implements the Expression interface.

func (*Pad) Resolved

func (p *Pad) Resolved() bool

Resolved implements the Expression interface.

func (*Pad) String

func (p *Pad) String() string

func (*Pad) Type

func (p *Pad) Type() sql.Type

Type implements the Expression interface.

func (*Pad) WithChildren

func (p *Pad) WithChildren(children ...sql.Expression) (sql.Expression, error)

WithChildren implements the Expression interface.

type Pi

type Pi struct{}

func (*Pi) Children

func (p *Pi) Children() []sql.Expression

Children implements sql.Expression

func (*Pi) CollationCoercibility

func (p *Pi) CollationCoercibility(ctx *sql.Context) (collation sql.CollationID, coercibility byte)

CollationCoercibility implements the interface sql.CollationCoercible.

func (*Pi) Description

func (p *Pi) Description() string

Description implements sql.FunctionExpression

func (*Pi) Eval

func (p *Pi) Eval(ctx *sql.Context, row sql.Row) (interface{}, error)

Eval implements sql.Expression

func (*Pi) FunctionName

func (p *Pi) FunctionName() string

FunctionName implements sql.FunctionExpression

func (*Pi) IsNullable

func (p *Pi) IsNullable() bool

IsNullable implements sql.Expression

func (*Pi) Resolved

func (p *Pi) Resolved() bool

Resolved implements sql.Expression

func (*Pi) String

func (p *Pi) String() string

String implements sql.Expression

func (*Pi) Type

func (p *Pi) Type() sql.Type

Type implements sql.Expression

func (*Pi) WithChildren

func (p *Pi) WithChildren(children ...sql.Expression) (sql.Expression, error)

WithChildren implements sql.Expression

type Power

type Power struct {
	expression.BinaryExpressionStub
}

Power is a function that returns value of X raised to the power of Y.

func (*Power) CollationCoercibility

func (*Power) CollationCoercibility(ctx *sql.Context) (collation sql.CollationID, coercibility byte)

CollationCoercibility implements the interface sql.CollationCoercible.

func (*Power) Description

func (p *Power) Description() string

Description implements sql.FunctionExpression

func (*Power) Eval

func (p *Power) Eval(ctx *sql.Context, row sql.Row) (interface{}, error)

Eval implements the Expression interface.

func (*Power) FunctionName

func (p *Power) FunctionName() string

FunctionName implements sql.FunctionExpression

func (*Power) IsNullable

func (p *Power) IsNullable() bool

IsNullable implements the Expression interface.

func (*Power) String

func (p *Power) String() string

func (*Power) Type

func (p *Power) Type() sql.Type

Type implements the Expression interface.

func (*Power) WithChildren

func (p *Power) WithChildren(children ...sql.Expression) (sql.Expression, error)

WithChildren implements the Expression interface.

type Quarter

type Quarter struct {
	expression.UnaryExpression
}

func (*Quarter) CollationCoercibility

func (q *Quarter) CollationCoercibility(ctx *sql.Context) (collation sql.CollationID, coercibility byte)

CollationCoercibility implements the interface sql.CollationCoercible.

func (*Quarter) Description

func (q *Quarter) Description() string

Description implements sql.FunctionExpression

func (*Quarter) Eval

func (q *Quarter) Eval(ctx *sql.Context, row sql.Row) (interface{}, error)

Eval implements the Expression interface.

func (*Quarter) FunctionName

func (q *Quarter) FunctionName() string

FunctionName implements sql.FunctionExpression

func (*Quarter) String

func (q *Quarter) String() string

func (*Quarter) Type

func (q *Quarter) Type() sql.Type

Type implements the Expression interface.

func (*Quarter) WithChildren

func (q *Quarter) WithChildren(children ...sql.Expression) (sql.Expression, error)

WithChildren implements the Expression interface.

type Radians

type Radians struct {
	*UnaryFunc
}

func (*Radians) CollationCoercibility

func (*Radians) CollationCoercibility(ctx *sql.Context) (collation sql.CollationID, coercibility byte)

CollationCoercibility implements the interface sql.CollationCoercible.

func (*Radians) Description

func (r *Radians) Description() string

Description implements sql.FunctionExpression

func (*Radians) Eval

func (r *Radians) Eval(ctx *sql.Context, row sql.Row) (interface{}, error)

Eval implements sql.Expression

func (*Radians) WithChildren

func (r *Radians) WithChildren(children ...sql.Expression) (sql.Expression, error)

WithChildren implements sql.Expression

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 sql.Expression

func (*Rand) CollationCoercibility

func (*Rand) CollationCoercibility(ctx *sql.Context) (collation sql.CollationID, coercibility byte)

CollationCoercibility implements the interface sql.CollationCoercible.

func (*Rand) Description

func (r *Rand) Description() string

Description implements sql.FunctionExpression

func (*Rand) Eval

func (r *Rand) Eval(ctx *sql.Context, row sql.Row) (interface{}, error)

Eval implements sql.Expression.

func (*Rand) FunctionName

func (r *Rand) FunctionName() string

FunctionName implements sql.FunctionExpression

func (*Rand) IsNonDeterministic

func (r *Rand) IsNonDeterministic() bool

IsNonDeterministic implements sql.NonDeterministicExpression

func (*Rand) IsNullable

func (r *Rand) IsNullable() bool

IsNullable implements sql.Expression

func (*Rand) Resolved

func (r *Rand) Resolved() bool

Resolved implements sql.Expression

func (*Rand) String

func (r *Rand) String() string

func (*Rand) Type

func (r *Rand) Type() sql.Type

Type implements sql.Expression.

func (*Rand) WithChildren

func (r *Rand) WithChildren(children ...sql.Expression) (sql.Expression, error)

WithChildren implements sql.Expression.

type RandomBytes

type RandomBytes struct {
	expression.UnaryExpression
}

RandomBytes returns a random binary string of the given length.

func (*RandomBytes) CollationCoercibility

func (*RandomBytes) CollationCoercibility(ctx *sql.Context) (collation sql.CollationID, coercibility byte)

CollationCoercibility implements the interface sql.CollationCoercible.

func (*RandomBytes) Description

func (r *RandomBytes) Description() string

Description implements sql.FunctionExpression

func (*RandomBytes) Eval

func (r *RandomBytes) Eval(ctx *sql.Context, row sql.Row) (interface{}, error)

Eval implements the sql.Expression interface.

func (*RandomBytes) FunctionName

func (r *RandomBytes) FunctionName() string

FunctionName implements sql.FunctionExpression

func (*RandomBytes) IsNonDeterministic

func (r *RandomBytes) IsNonDeterministic() bool

IsNonDeterministic implements the sql.Expression interface.

func (*RandomBytes) String

func (r *RandomBytes) String() string

String implements the sql.Expression interface.

func (*RandomBytes) Type

func (r *RandomBytes) Type() sql.Type

Type implements the sql.Expression interface.

func (*RandomBytes) WithChildren

func (r *RandomBytes) WithChildren(children ...sql.Expression) (sql.Expression, error)

WithChildren implements the Expression interface.

type RegexpLike

type RegexpLike struct {
	Text    sql.Expression
	Pattern sql.Expression
	Flags   sql.Expression
	// contains filtered or unexported fields
}

RegexpLike implements the REGEXP_LIKE function. https://dev.mysql.com/doc/refman/8.0/en/regexp.html#function_regexp-like

func (*RegexpLike) Children

func (r *RegexpLike) Children() []sql.Expression

Children implements the sql.Expression interface.

func (*RegexpLike) Close

func (r *RegexpLike) Close(ctx *sql.Context) error

Close implements the sql.Closer interface.

func (*RegexpLike) CollationCoercibility

func (r *RegexpLike) CollationCoercibility(ctx *sql.Context) (collation sql.CollationID, coercibility byte)

CollationCoercibility implements the interface sql.CollationCoercible.

func (*RegexpLike) Description

func (r *RegexpLike) Description() string

Description implements sql.FunctionExpression

func (*RegexpLike) Eval

func (r *RegexpLike) Eval(ctx *sql.Context, row sql.Row) (interface{}, error)

Eval implements the sql.Expression interface.

func (*RegexpLike) FunctionName

func (r *RegexpLike) FunctionName() string

FunctionName implements sql.FunctionExpression

func (*RegexpLike) IsNullable

func (r *RegexpLike) IsNullable() bool

IsNullable implements the sql.Expression interface.

func (*RegexpLike) Resolved

func (r *RegexpLike) Resolved() bool

Resolved implements the sql.Expression interface.

func (*RegexpLike) String

func (r *RegexpLike) String() string

func (*RegexpLike) Type

func (r *RegexpLike) Type() sql.Type

Type implements the sql.Expression interface.

func (*RegexpLike) WithChildren

func (r *RegexpLike) WithChildren(children ...sql.Expression) (sql.Expression, error)

WithChildren implements the sql.Expression interface.

type RegexpReplace

type RegexpReplace struct {
	// contains filtered or unexported fields
}

RegexpReplace implements the REGEXP_REPLACE function. https://dev.mysql.com/doc/refman/8.0/en/regexp.html#function_regexp-replace

func (*RegexpReplace) Children

func (r *RegexpReplace) Children() []sql.Expression

Children implements the sql.Expression interface.

func (*RegexpReplace) CollationCoercibility

func (r *RegexpReplace) CollationCoercibility(ctx *sql.Context) (collation sql.CollationID, coercibility byte)

CollationCoercibility implements the interface sql.CollationCoercible.

func (*RegexpReplace) Description

func (r *RegexpReplace) Description() string

Description implements sql.FunctionExpression

func (*RegexpReplace) Eval

func (r *RegexpReplace) Eval(ctx *sql.Context, row sql.Row) (val interface{}, err error)

Eval implements the sql.Expression interface.

func (*RegexpReplace) FunctionName

func (r *RegexpReplace) FunctionName() string

FunctionName implements sql.FunctionExpression

func (*RegexpReplace) IsNullable

func (r *RegexpReplace) IsNullable() bool

IsNullable implements the sql.Expression interface.

func (*RegexpReplace) Resolved

func (r *RegexpReplace) Resolved() bool

Resolved implements the sql.Expression interface.

func (*RegexpReplace) String

func (r *RegexpReplace) String() string

func (*RegexpReplace) Type

func (r *RegexpReplace) Type() sql.Type

Type implements the sql.Expression interface.

func (*RegexpReplace) WithChildren

func (r *RegexpReplace) WithChildren(children ...sql.Expression) (sql.Expression, error)

WithChildren implements the sql.Expression interface.

type Registry

type Registry map[string]sql.Function

Registry is used to register functions

func NewRegistry

func NewRegistry() Registry

NewRegistry creates a new Registry.

func (Registry) Function

func (r Registry) Function(ctx *sql.Context, name string) (sql.Function, error)

Function implements sql.FunctionProvider

func (Registry) Register

func (r Registry) Register(fn ...sql.Function) error

Register registers functions, returning an error if it's already registered

type ReleaseAllLocks

type ReleaseAllLocks struct {
	NoArgFunc
	// contains filtered or unexported fields
}

func (ReleaseAllLocks) CollationCoercibility

func (ReleaseAllLocks) CollationCoercibility(ctx *sql.Context) (collation sql.CollationID, coercibility byte)

CollationCoercibility implements the interface sql.CollationCoercible.

func (ReleaseAllLocks) Description

func (r ReleaseAllLocks) Description() string

Description implements sql.FunctionExpression

func (ReleaseAllLocks) Eval

func (r ReleaseAllLocks) Eval(ctx *sql.Context, row sql.Row) (interface{}, error)

func (ReleaseAllLocks) WithChildren

func (r ReleaseAllLocks) WithChildren(children ...sql.Expression) (sql.Expression, error)

type ReleaseLock

type ReleaseLock struct {
	NamedLockFunction
}

func (*ReleaseLock) CollationCoercibility

func (*ReleaseLock) CollationCoercibility(ctx *sql.Context) (collation sql.CollationID, coercibility byte)

CollationCoercibility implements the interface sql.CollationCoercible.

func (*ReleaseLock) Description

func (i *ReleaseLock) Description() string

Description implements sql.FunctionExpression

func (*ReleaseLock) Eval

func (i *ReleaseLock) Eval(ctx *sql.Context, row sql.Row) (interface{}, error)

func (*ReleaseLock) WithChildren

func (i *ReleaseLock) WithChildren(children ...sql.Expression) (sql.Expression, error)

type Repeat

type Repeat struct {
	expression.BinaryExpressionStub
}

Repeat is a function that returns the string repeated n times.

func (*Repeat) CollationCoercibility

func (r *Repeat) CollationCoercibility(ctx *sql.Context) (collation sql.CollationID, coercibility byte)

CollationCoercibility implements the interface sql.CollationCoercible.

func (*Repeat) Description

func (r *Repeat) Description() string

Description implements sql.FunctionExpression

func (*Repeat) Eval

func (r *Repeat) Eval(
	ctx *sql.Context,
	row sql.Row,
) (interface{}, error)

Eval implements the Expression interface.

func (*Repeat) FunctionName

func (r *Repeat) FunctionName() string

FunctionName implements sql.FunctionExpression

func (*Repeat) String

func (r *Repeat) String() string

func (*Repeat) Type

func (r *Repeat) Type() sql.Type

Type implements the Expression interface.

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) CollationCoercibility

func (r *Replace) CollationCoercibility(ctx *sql.Context) (collation sql.CollationID, coercibility byte)

CollationCoercibility implements the interface sql.CollationCoercible.

func (*Replace) Description

func (r *Replace) Description() string

Description implements sql.FunctionExpression

func (*Replace) Eval

func (r *Replace) Eval(
	ctx *sql.Context,
	row sql.Row,
) (interface{}, error)

Eval implements the Expression interface.

func (*Replace) FunctionName

func (r *Replace) FunctionName() string

FunctionName implements sql.FunctionExpression

func (*Replace) IsNullable

func (r *Replace) IsNullable() bool

IsNullable implements the Expression interface.

func (*Replace) Resolved

func (r *Replace) Resolved() bool

Resolved implements the Expression interface.

func (*Replace) String

func (r *Replace) String() string

func (*Replace) Type

func (r *Replace) Type() sql.Type

Type 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) CollationCoercibility

func (r *Reverse) CollationCoercibility(ctx *sql.Context) (collation sql.CollationID, coercibility byte)

CollationCoercibility implements the interface sql.CollationCoercible.

func (*Reverse) Description

func (r *Reverse) Description() string

Description implements sql.FunctionExpression

func (*Reverse) Eval

func (r *Reverse) Eval(
	ctx *sql.Context,
	row sql.Row,
) (interface{}, error)

Eval implements the Expression interface.

func (*Reverse) FunctionName

func (r *Reverse) FunctionName() string

FunctionName implements sql.FunctionExpression

func (*Reverse) String

func (r *Reverse) String() string

func (*Reverse) Type

func (r *Reverse) Type() sql.Type

Type implements the Expression interface.

func (*Reverse) WithChildren

func (r *Reverse) WithChildren(children ...sql.Expression) (sql.Expression, error)

WithChildren implements the Expression interface.

type Right struct {
	// contains filtered or unexported fields
}

Right is a function that returns the last N characters of a string expression.

func (Right) Children

func (r Right) Children() []sql.Expression

Children implements the Expression interface.

func (Right) CollationCoercibility

func (r Right) CollationCoercibility(ctx *sql.Context) (collation sql.CollationID, coercibility byte)

CollationCoercibility implements the interface sql.CollationCoercible.

func (Right) DebugString

func (r Right) DebugString() string

func (Right) Description

func (r Right) Description() string

Description implements sql.FunctionExpression

func (Right) Eval

func (r Right) Eval(ctx *sql.Context, row sql.Row) (interface{}, error)

Eval implements the Expression interface.

func (Right) FunctionName

func (r Right) FunctionName() string

FunctionName implements sql.FunctionExpression

func (Right) IsNullable

func (r Right) IsNullable() bool

IsNullable implements the Expression interface.

func (Right) Resolved

func (r Right) Resolved() bool

Resolved implements the Expression interface.

func (Right) String

func (r Right) String() string

func (Right) Type

func (Right) Type() sql.Type

Type implements the Expression interface.

func (Right) WithChildren

func (r Right) WithChildren(children ...sql.Expression) (sql.Expression, error)

WithChildren implements the Expression interface.

type RightTrim

type RightTrim struct {
	expression.UnaryExpression
}

func (*RightTrim) CollationCoercibility

func (t *RightTrim) CollationCoercibility(ctx *sql.Context) (collation sql.CollationID, coercibility byte)

CollationCoercibility implements the interface sql.CollationCoercible.

func (*RightTrim) Description

func (t *RightTrim) Description() string

Description implements sql.FunctionExpression

func (*RightTrim) Eval

func (t *RightTrim) Eval(ctx *sql.Context, row sql.Row) (interface{}, error)

func (*RightTrim) FunctionName

func (t *RightTrim) FunctionName() string

FunctionName implements sql.FunctionExpression

func (*RightTrim) IsNullable

func (t *RightTrim) IsNullable() bool

func (*RightTrim) String

func (t *RightTrim) String() string

func (*RightTrim) Type

func (t *RightTrim) Type() sql.Type

func (*RightTrim) WithChildren

func (t *RightTrim) WithChildren(children ...sql.Expression) (sql.Expression, error)

type Round

type Round struct {
	expression.BinaryExpressionStub
}

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) CollationCoercibility

func (*Round) CollationCoercibility(ctx *sql.Context) (collation sql.CollationID, coercibility byte)

CollationCoercibility implements the interface sql.CollationCoercible.

func (*Round) Description

func (r *Round) Description() string

Description implements sql.FunctionExpression

func (*Round) Eval

func (r *Round) Eval(ctx *sql.Context, row sql.Row) (interface{}, error)

Eval implements the Expression interface.

func (*Round) FunctionName

func (r *Round) FunctionName() string

FunctionName implements sql.FunctionExpression

func (*Round) IsNullable

func (r *Round) IsNullable() bool

IsNullable implements the Expression interface.

func (*Round) Resolved

func (r *Round) Resolved() bool

Resolved implements the Expression interface.

func (*Round) String

func (r *Round) String() string

func (*Round) Type

func (r *Round) Type() sql.Type

Type implements the Expression interface.

func (*Round) WithChildren

func (r *Round) WithChildren(children ...sql.Expression) (sql.Expression, error)

WithChildren implements the Expression interface.

type RowCount

type RowCount struct{}

RowCount implements the ROW_COUNT() function

func (RowCount) Children

func (r RowCount) Children() []sql.Expression

Children implements sql.Expression

func (RowCount) CollationCoercibility

func (RowCount) CollationCoercibility(ctx *sql.Context) (collation sql.CollationID, coercibility byte)

CollationCoercibility implements the interface sql.CollationCoercible.

func (RowCount) Description

func (r RowCount) Description() string

Description implements sql.FunctionExpression

func (RowCount) Eval

func (r RowCount) Eval(ctx *sql.Context, row sql.Row) (interface{}, error)

Eval implements sql.Expression

func (RowCount) FunctionName

func (r RowCount) FunctionName() string

FunctionName implements sql.FunctionExpression

func (RowCount) IsNonDeterministic

func (r RowCount) IsNonDeterministic() bool

func (RowCount) IsNullable

func (r RowCount) IsNullable() bool

IsNullable implements sql.Expression

func (RowCount) Resolved

func (r RowCount) Resolved() bool

Resolved implements sql.Expression

func (RowCount) String

func (r RowCount) String() string

String implements sql.Expression

func (RowCount) Type

func (r RowCount) Type() sql.Type

Type implements sql.Expression

func (RowCount) WithChildren

func (r RowCount) WithChildren(children ...sql.Expression) (sql.Expression, error)

WithChildren implements sql.Expression

type SHA1

type SHA1 struct {
	*UnaryFunc
}

SHA1 function returns the SHA1 hash of the input. https://dev.mysql.com/doc/refman/8.0/en/encryption-functions.html#function_sha1

func (*SHA1) CollationCoercibility

func (*SHA1) CollationCoercibility(ctx *sql.Context) (collation sql.CollationID, coercibility byte)

CollationCoercibility implements the interface sql.CollationCoercible.

func (*SHA1) Description

func (f *SHA1) Description() string

Description implements sql.FunctionExpression

func (*SHA1) Eval

func (f *SHA1) Eval(ctx *sql.Context, row sql.Row) (interface{}, error)

Eval implements sql.Expression

func (*SHA1) WithChildren

func (f *SHA1) WithChildren(children ...sql.Expression) (sql.Expression, error)

WithChildren implements sql.Expression

type SHA2

type SHA2 struct {
	expression.BinaryExpressionStub
}

SHA2 function returns the SHA-224/256/384/512 hash of the input. https://dev.mysql.com/doc/refman/8.0/en/encryption-functions.html#function_sha2

func (*SHA2) CollationCoercibility

func (*SHA2) CollationCoercibility(ctx *sql.Context) (collation sql.CollationID, coercibility byte)

CollationCoercibility implements the interface sql.CollationCoercible.

func (*SHA2) Description

func (f *SHA2) Description() string

Description implements sql.FunctionExpression

func (*SHA2) Eval

func (f *SHA2) Eval(ctx *sql.Context, row sql.Row) (interface{}, error)

Eval implements sql.Expression

func (*SHA2) FunctionName

func (f *SHA2) FunctionName() string

FunctionName implements sql.FunctionExpression

func (*SHA2) String

func (f *SHA2) String() string

String implements sql.Expression

func (*SHA2) Type

func (f *SHA2) Type() sql.Type

Type implements sql.Expression

func (*SHA2) WithChildren

func (f *SHA2) WithChildren(children ...sql.Expression) (sql.Expression, error)

WithChildren implements sql.Expression

type Second

type Second struct {
	expression.UnaryExpression
}

Second is a function that returns the second of a date.

func (*Second) CollationCoercibility

func (*Second) CollationCoercibility(ctx *sql.Context) (collation sql.CollationID, coercibility byte)

CollationCoercibility implements the interface sql.CollationCoercible.

func (*Second) Description

func (s *Second) Description() string

Description implements sql.FunctionExpression

func (*Second) Eval

func (s *Second) Eval(ctx *sql.Context, row sql.Row) (interface{}, error)

Eval implements the Expression interface.

func (*Second) FunctionName

func (s *Second) FunctionName() string

FunctionName implements sql.FunctionExpression

func (*Second) String

func (s *Second) String() string

func (*Second) Type

func (s *Second) Type() sql.Type

Type implements the Expression interface.

func (*Second) WithChildren

func (s *Second) WithChildren(children ...sql.Expression) (sql.Expression, error)

WithChildren implements the Expression interface.

type Sign

type Sign struct {
	*UnaryFunc
}

func (*Sign) CollationCoercibility

func (*Sign) CollationCoercibility(ctx *sql.Context) (collation sql.CollationID, coercibility byte)

CollationCoercibility implements the interface sql.CollationCoercible.

func (*Sign) Description

func (s *Sign) Description() string

Description implements sql.FunctionExpression

func (*Sign) Eval

func (s *Sign) Eval(ctx *sql.Context, row sql.Row) (interface{}, error)

Eval implements sql.Expression

func (*Sign) WithChildren

func (s *Sign) WithChildren(children ...sql.Expression) (sql.Expression, error)

WithChildren implements sql.Expression

type Sin

type Sin struct {
	*UnaryFunc
}

Sin is the SIN function

func (*Sin) CollationCoercibility

func (*Sin) CollationCoercibility(ctx *sql.Context) (collation sql.CollationID, coercibility byte)

CollationCoercibility implements the interface sql.CollationCoercible.

func (*Sin) Description

func (s *Sin) Description() string

Description implements sql.FunctionExpression

func (*Sin) Eval

func (s *Sin) Eval(ctx *sql.Context, row sql.Row) (interface{}, error)

Eval implements sql.Expression

func (*Sin) WithChildren

func (s *Sin) WithChildren(children ...sql.Expression) (sql.Expression, error)

WithChildren implements sql.Expression

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) CollationCoercibility

func (*Sleep) CollationCoercibility(ctx *sql.Context) (collation sql.CollationID, coercibility byte)

CollationCoercibility implements the interface sql.CollationCoercible.

func (*Sleep) Description

func (s *Sleep) Description() string

Description implements sql.FunctionExpression

func (*Sleep) Eval

func (s *Sleep) Eval(ctx *sql.Context, row sql.Row) (interface{}, error)

Eval implements the Expression interface.

func (*Sleep) FunctionName

func (s *Sleep) FunctionName() string

FunctionName implements sql.FunctionExpression

func (*Sleep) IsNullable

func (s *Sleep) IsNullable() bool

IsNullable implements the Expression interface.

func (*Sleep) String

func (s *Sleep) String() string

String implements the fmt.Stringer interface.

func (*Sleep) Type

func (s *Sleep) Type() sql.Type

Type 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) CollationCoercibility

func (*Soundex) CollationCoercibility(ctx *sql.Context) (collation sql.CollationID, coercibility byte)

CollationCoercibility implements the interface sql.CollationCoercible.

func (*Soundex) Description

func (s *Soundex) Description() string

Description implements sql.FunctionExpression

func (*Soundex) Eval

func (s *Soundex) Eval(ctx *sql.Context, row sql.Row) (interface{}, error)

Eval implements the Expression interface.

func (*Soundex) FunctionName

func (s *Soundex) FunctionName() string

FunctionName implements sql.FunctionExpression

func (*Soundex) String

func (s *Soundex) String() string

func (*Soundex) Type

func (s *Soundex) Type() sql.Type

Type implements the Expression interface.

func (*Soundex) WithChildren

func (s *Soundex) WithChildren(children ...sql.Expression) (sql.Expression, error)

WithChildren implements the Expression interface.

type Space

type Space struct {
	*UnaryFunc
}

Space implements the sql function "space" which returns a string with the number of spaces specified by the argument

func (*Space) CollationCoercibility

func (s *Space) CollationCoercibility(ctx *sql.Context) (collation sql.CollationID, coercibility byte)

CollationCoercibility implements the interface sql.CollationCoercible.

func (*Space) Description

func (s *Space) Description() string

Description implements sql.FunctionExpression

func (*Space) Eval

func (s *Space) Eval(ctx *sql.Context, row sql.Row) (interface{}, error)

Eval implements the sql.Expression interface

func (*Space) WithChildren

func (s *Space) WithChildren(children ...sql.Expression) (sql.Expression, error)

WithChildren implements the sql.Expression interface

type Sqrt

type Sqrt struct {
	expression.UnaryExpression
}

Sqrt is a function that returns the square value of the number provided.

func (*Sqrt) CollationCoercibility

func (*Sqrt) CollationCoercibility(ctx *sql.Context) (collation sql.CollationID, coercibility byte)

CollationCoercibility implements the interface sql.CollationCoercible.

func (*Sqrt) Description

func (s *Sqrt) Description() string

Description implements sql.FunctionExpression

func (*Sqrt) Eval

func (s *Sqrt) Eval(ctx *sql.Context, row sql.Row) (interface{}, error)

Eval implements the Expression interface.

func (*Sqrt) FunctionName

func (s *Sqrt) FunctionName() string

FunctionName implements sql.FunctionExpression

func (*Sqrt) IsNullable

func (s *Sqrt) IsNullable() bool

IsNullable implements the Expression interface.

func (*Sqrt) String

func (s *Sqrt) String() string

func (*Sqrt) Type

func (s *Sqrt) Type() sql.Type

Type implements the Expression interface.

func (*Sqrt) WithChildren

func (s *Sqrt) WithChildren(children ...sql.Expression) (sql.Expression, error)

WithChildren implements the Expression interface.

type StrCmp

type StrCmp struct {
	expression.BinaryExpressionStub
}

StrCmp compares two strings

func (*StrCmp) CollationCoercibility

func (s *StrCmp) CollationCoercibility(ctx *sql.Context) (collation sql.CollationID, coercibility byte)

CollationCoercibility implements the interface sql.CollationCoercible.

func (*StrCmp) Description

func (s *StrCmp) Description() string

Description implements sql.FunctionExpression

func (*StrCmp) Eval

func (s *StrCmp) Eval(ctx *sql.Context, row sql.Row) (interface{}, error)

func (*StrCmp) FunctionName

func (s *StrCmp) FunctionName() string

FunctionName implements sql.FunctionExpression

func (*StrCmp) String

func (s *StrCmp) String() string

func (*StrCmp) Type

func (s *StrCmp) Type() sql.Type

Type implements the Expression interface.

func (*StrCmp) WithChildren

func (s *StrCmp) WithChildren(children ...sql.Expression) (sql.Expression, error)

WithChildren implements the Expression interface.

type StrToDate

type StrToDate struct {
	Date   sql.Expression
	Format sql.Expression
}

StrToDate defines the built-in function STR_TO_DATE(str, format)

func (StrToDate) Children

func (s StrToDate) Children() []sql.Expression

Children returns the children expressions of this expression.

func (StrToDate) CollationCoercibility

func (StrToDate) CollationCoercibility(ctx *sql.Context) (collation sql.CollationID, coercibility byte)

CollationCoercibility implements the interface sql.CollationCoercible.

func (StrToDate) Description

func (s StrToDate) Description() string

Description implements sql.FunctionExpression

func (StrToDate) Eval

func (s StrToDate) Eval(ctx *sql.Context, row sql.Row) (interface{}, error)

Eval evaluates the given row and returns a result.

func (StrToDate) FunctionName

func (s StrToDate) FunctionName() string

func (StrToDate) IsNullable

func (s StrToDate) IsNullable() bool

IsNullable returns whether the expression can be null.

func (StrToDate) Resolved

func (s StrToDate) Resolved() bool

Resolved returns whether the node is resolved.

func (StrToDate) String

func (s StrToDate) String() string

func (StrToDate) Type

func (s StrToDate) Type() sql.Type

Type returns the expression type.

func (StrToDate) WithChildren

func (s StrToDate) WithChildren(children ...sql.Expression) (sql.Expression, error)

type Substring

type Substring struct {
	Str   sql.Expression
	Start sql.Expression
	Len   sql.Expression
}

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) CollationCoercibility

func (s *Substring) CollationCoercibility(ctx *sql.Context) (collation sql.CollationID, coercibility byte)

CollationCoercibility implements the interface sql.CollationCoercible.

func (*Substring) Description

func (s *Substring) Description() string

Description implements sql.FunctionExpression

func (*Substring) Eval

func (s *Substring) Eval(
	ctx *sql.Context,
	row sql.Row,
) (interface{}, error)

Eval implements the Expression interface.

func (*Substring) FunctionName

func (s *Substring) FunctionName() string

FunctionName implements sql.FunctionExpression

func (*Substring) IsNullable

func (s *Substring) IsNullable() bool

IsNullable implements the Expression interface.

func (*Substring) Resolved

func (s *Substring) Resolved() bool

Resolved implements the Expression interface.

func (*Substring) String

func (s *Substring) String() string

func (*Substring) Type

func (s *Substring) Type() sql.Type

Type 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) CollationCoercibility

func (s *SubstringIndex) CollationCoercibility(ctx *sql.Context) (collation sql.CollationID, coercibility byte)

CollationCoercibility implements the interface sql.CollationCoercible.

func (*SubstringIndex) Description

func (s *SubstringIndex) Description() string

Description implements sql.FunctionExpression

func (*SubstringIndex) Eval

func (s *SubstringIndex) Eval(ctx *sql.Context, row sql.Row) (interface{}, error)

Eval implements the Expression interface.

func (*SubstringIndex) FunctionName

func (s *SubstringIndex) FunctionName() string

FunctionName implements sql.FunctionExpression

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 Tan

type Tan struct {
	*UnaryFunc
}

func (*Tan) CollationCoercibility

func (*Tan) CollationCoercibility(ctx *sql.Context) (collation sql.CollationID, coercibility byte)

CollationCoercibility implements the interface sql.CollationCoercible.

func (*Tan) Description

func (t *Tan) Description() string

Description implements sql.FunctionExpression

func (*Tan) Eval

func (t *Tan) Eval(ctx *sql.Context, row sql.Row) (interface{}, error)

Eval implements sql.Expression

func (*Tan) WithChildren

func (t *Tan) WithChildren(children ...sql.Expression) (sql.Expression, error)

WithChildren implements sql.Expression

type Time

type Time struct {
	expression.UnaryExpression
}

Time is a function takes the Time part out from a datetime expression.

func (*Time) CollationCoercibility

func (*Time) CollationCoercibility(ctx *sql.Context) (collation sql.CollationID, coercibility byte)

CollationCoercibility implements the interface sql.CollationCoercible.

func (*Time) Description

func (t *Time) Description() string

func (*Time) Eval

func (t *Time) Eval(ctx *sql.Context, row sql.Row) (interface{}, error)

Eval implements the Expression interface.

func (*Time) FunctionName

func (t *Time) FunctionName() string

func (*Time) String

func (t *Time) String() string

func (*Time) Type

func (t *Time) Type() sql.Type

Type implements the Expression interface.

func (*Time) WithChildren

func (t *Time) WithChildren(children ...sql.Expression) (sql.Expression, error)

WithChildren implements the Expression interface.

type TimeDiff

type TimeDiff struct {
	expression.BinaryExpressionStub
}

TimeDiff subtracts the second argument from the first expressed as a time value.

func (*TimeDiff) CollationCoercibility

func (*TimeDiff) CollationCoercibility(ctx *sql.Context) (collation sql.CollationID, coercibility byte)

CollationCoercibility implements the interface sql.CollationCoercible.

func (*TimeDiff) Description

func (td *TimeDiff) Description() string

Description implements sql.FunctionExpression

func (*TimeDiff) Eval

func (td *TimeDiff) Eval(ctx *sql.Context, row sql.Row) (interface{}, error)

Eval implements the Expression interface.

func (*TimeDiff) FunctionName

func (td *TimeDiff) FunctionName() string

FunctionName implements sql.FunctionExpression

func (*TimeDiff) String

func (td *TimeDiff) String() string

func (*TimeDiff) Type

func (td *TimeDiff) Type() sql.Type

Type implements the Expression interface.

func (*TimeDiff) WithChildren

func (td *TimeDiff) WithChildren(children ...sql.Expression) (sql.Expression, error)

WithChildren implements the Expression interface.

type TimeFormat

type TimeFormat struct {
	expression.BinaryExpressionStub
}

TimeFormat function returns a string representation of the date specified in the format specified

func (*TimeFormat) CollationCoercibility

func (*TimeFormat) CollationCoercibility(ctx *sql.Context) (collation sql.CollationID, coercibility byte)

CollationCoercibility implements the interface sql.CollationCoercible.

func (*TimeFormat) Description

func (f *TimeFormat) Description() string

Description implements sql.FunctionExpression

func (*TimeFormat) Eval

func (f *TimeFormat) Eval(ctx *sql.Context, row sql.Row) (interface{}, error)

Eval implements the Expression interface.

func (*TimeFormat) FunctionName

func (f *TimeFormat) FunctionName() string

FunctionName implements sql.FunctionExpression

func (*TimeFormat) IsNullable

func (f *TimeFormat) IsNullable() bool

IsNullable implements the Expression interface.

func (*TimeFormat) String

func (f *TimeFormat) String() string

func (*TimeFormat) Type

func (f *TimeFormat) Type() sql.Type

Type implements the Expression interface.

func (*TimeFormat) WithChildren

func (f *TimeFormat) WithChildren(children ...sql.Expression) (sql.Expression, error)

WithChildren implements the Expression interface.

type TimeToSec

type TimeToSec struct {
	*UnaryDatetimeFunc
}

TimeToSec implements the time_to_sec function

func (*TimeToSec) CollationCoercibility

func (*TimeToSec) CollationCoercibility(ctx *sql.Context) (collation sql.CollationID, coercibility byte)

CollationCoercibility implements the interface sql.CollationCoercible.

func (*TimeToSec) Description

func (m *TimeToSec) Description() string

Description implements sql.FunctionExpression

func (*TimeToSec) Eval

func (m *TimeToSec) Eval(ctx *sql.Context, row sql.Row) (interface{}, error)

func (*TimeToSec) WithChildren

func (m *TimeToSec) WithChildren(children ...sql.Expression) (sql.Expression, error)

type TimestampConversion

type TimestampConversion struct {
	Date sql.Expression
}

TimestampConversion is a shorthand function for CONVERT(expr, TIMESTAMP)

func (*TimestampConversion) Children

func (t *TimestampConversion) Children() []sql.Expression

func (*TimestampConversion) CollationCoercibility

func (*TimestampConversion) CollationCoercibility(ctx *sql.Context) (collation sql.CollationID, coercibility byte)

CollationCoercibility implements the interface sql.CollationCoercible.

func (*TimestampConversion) Description

func (t *TimestampConversion) Description() string

Description implements sql.FunctionExpression

func (*TimestampConversion) Eval

func (t *TimestampConversion) Eval(ctx *sql.Context, r sql.Row) (interface{}, error)

func (*TimestampConversion) FunctionName

func (t *TimestampConversion) FunctionName() string

FunctionName implements sql.FunctionExpression

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 TimestampDiff

type TimestampDiff struct {
	// contains filtered or unexported fields
}

TimestampDiff returns expr1 − expr2 expressed as a value in unit specified.

func (*TimestampDiff) Children

func (t *TimestampDiff) Children() []sql.Expression

Children implements the sql.Expression interface.

func (*TimestampDiff) CollationCoercibility

func (*TimestampDiff) CollationCoercibility(ctx *sql.Context) (collation sql.CollationID, coercibility byte)

CollationCoercibility implements the interface sql.CollationCoercible.

func (*TimestampDiff) Description

func (t *TimestampDiff) Description() string

Description implements sql.FunctionExpression

func (*TimestampDiff) Eval

func (t *TimestampDiff) Eval(ctx *sql.Context, row sql.Row) (interface{}, error)

Eval implements the sql.Expression interface.

func (*TimestampDiff) FunctionName

func (t *TimestampDiff) FunctionName() string

FunctionName implements sql.FunctionExpression

func (*TimestampDiff) IsNullable

func (t *TimestampDiff) IsNullable() bool

IsNullable implements the sql.Expression interface.

func (*TimestampDiff) Resolved

func (t *TimestampDiff) Resolved() bool

Resolved implements the sql.Expression interface.

func (*TimestampDiff) String

func (t *TimestampDiff) String() string

func (*TimestampDiff) Type

func (t *TimestampDiff) Type() sql.Type

Type implements the sql.Expression interface.

func (*TimestampDiff) WithChildren

func (t *TimestampDiff) WithChildren(children ...sql.Expression) (sql.Expression, error)

WithChildren implements the Expression interface.

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) CollationCoercibility

func (*ToBase64) CollationCoercibility(ctx *sql.Context) (collation sql.CollationID, coercibility byte)

CollationCoercibility implements the interface sql.CollationCoercible.

func (*ToBase64) Description

func (t *ToBase64) Description() string

Description implements sql.FunctionExpression

func (*ToBase64) Eval

func (t *ToBase64) Eval(ctx *sql.Context, row sql.Row) (interface{}, error)

Eval implements the Expression interface.

func (*ToBase64) FunctionName

func (t *ToBase64) FunctionName() string

FunctionName implements sql.FunctionExpression

func (*ToBase64) IsNullable

func (t *ToBase64) IsNullable() bool

IsNullable implements the Expression interface.

func (*ToBase64) String

func (t *ToBase64) String() string

String implements the fmt.Stringer interface.

func (*ToBase64) Type

func (t *ToBase64) Type() sql.Type

Type 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 {
	// contains filtered or unexported fields
}

func (*Trim) Children

func (t *Trim) Children() []sql.Expression

Children implements the Expression interface.

func (Trim) CollationCoercibility

func (t Trim) CollationCoercibility(ctx *sql.Context) (collation sql.CollationID, coercibility byte)

CollationCoercibility implements the interface sql.CollationCoercible.

func (*Trim) Description

func (t *Trim) Description() string

Description implements sql.FunctionExpression

func (*Trim) Eval

func (t *Trim) Eval(ctx *sql.Context, row sql.Row) (interface{}, error)

Eval implements the Expression interface.

func (*Trim) FunctionName

func (t *Trim) FunctionName() string

FunctionName implements sql.FunctionExpression

func (Trim) IsNullable

func (t Trim) IsNullable() bool

IsNullable implements the Expression interface.

func (Trim) Resolved

func (t Trim) Resolved() bool

func (Trim) String

func (t Trim) String() string

func (Trim) Type

func (t Trim) Type() sql.Type

func (Trim) WithChildren

func (t Trim) WithChildren(children ...sql.Expression) (sql.Expression, error)

type UTCTimestamp

type UTCTimestamp struct {
	// contains filtered or unexported fields
}

UTCTimestamp is a function that returns the current time.

func (*UTCTimestamp) Children

func (ut *UTCTimestamp) Children() []sql.Expression

Children implements the sql.Expression interface.

func (*UTCTimestamp) CollationCoercibility

func (*UTCTimestamp) CollationCoercibility(ctx *sql.Context) (collation sql.CollationID, coercibility byte)

CollationCoercibility implements the interface sql.CollationCoercible.

func (*UTCTimestamp) Description

func (ut *UTCTimestamp) Description() string

Description implements sql.FunctionExpression

func (*UTCTimestamp) Eval

func (ut *UTCTimestamp) Eval(ctx *sql.Context, _ sql.Row) (interface{}, error)

Eval implements the sql.Expression interface.

func (*UTCTimestamp) FunctionName

func (ut *UTCTimestamp) FunctionName() string

FunctionName implements sql.FunctionExpression

func (*UTCTimestamp) IsNullable

func (ut *UTCTimestamp) IsNullable() bool

IsNullable implements the sql.Expression interface.

func (*UTCTimestamp) Resolved

func (ut *UTCTimestamp) Resolved() bool

Resolved implements the sql.Expression interface.

func (*UTCTimestamp) String

func (ut *UTCTimestamp) String() string

func (*UTCTimestamp) Type

func (ut *UTCTimestamp) Type() sql.Type

Type implements the sql.Expression interface.

func (*UTCTimestamp) WithChildren

func (ut *UTCTimestamp) WithChildren(children ...sql.Expression) (sql.Expression, error)

WithChildren implements the Expression interface.

type UUIDFunc

type UUIDFunc struct{}

func (UUIDFunc) Children

func (u UUIDFunc) Children() []sql.Expression

Children returns the children expressions of this expression.

func (UUIDFunc) CollationCoercibility

func (UUIDFunc) CollationCoercibility(ctx *sql.Context) (collation sql.CollationID, coercibility byte)

CollationCoercibility implements the interface sql.CollationCoercible.

func (UUIDFunc) Description

func (u UUIDFunc) Description() string

Description implements sql.FunctionExpression

func (UUIDFunc) Eval

func (u UUIDFunc) Eval(ctx *sql.Context, row sql.Row) (interface{}, error)

func (UUIDFunc) FunctionName

func (u UUIDFunc) FunctionName() string

func (UUIDFunc) IsNonDeterministic

func (u UUIDFunc) IsNonDeterministic() bool

func (UUIDFunc) IsNullable

func (u UUIDFunc) IsNullable() bool

IsNullable returns whether the expression can be null.

func (UUIDFunc) Resolved

func (u UUIDFunc) Resolved() bool

func (UUIDFunc) String

func (u UUIDFunc) String() string

func (UUIDFunc) Type

func (u UUIDFunc) Type() sql.Type

func (UUIDFunc) WithChildren

func (u UUIDFunc) WithChildren(children ...sql.Expression) (sql.Expression, error)

type UUIDToBin

type UUIDToBin struct {
	// contains filtered or unexported fields
}

func (UUIDToBin) Children

func (ub UUIDToBin) Children() []sql.Expression

Children returns the children expressions of this expression.

func (UUIDToBin) CollationCoercibility

func (UUIDToBin) CollationCoercibility(ctx *sql.Context) (collation sql.CollationID, coercibility byte)

CollationCoercibility implements the interface sql.CollationCoercible.

func (UUIDToBin) Description

func (ub UUIDToBin) Description() string

Description implements sql.FunctionExpression

func (*UUIDToBin) Eval

func (ub *UUIDToBin) Eval(ctx *sql.Context, row sql.Row) (interface{}, error)

func (UUIDToBin) FunctionName

func (ub UUIDToBin) FunctionName() string

func (UUIDToBin) IsNullable

func (ub UUIDToBin) IsNullable() bool

IsNullable returns whether the expression can be null.

func (UUIDToBin) Resolved

func (ub UUIDToBin) Resolved() bool

func (UUIDToBin) String

func (ub UUIDToBin) String() string

func (UUIDToBin) Type

func (ub UUIDToBin) Type() sql.Type

func (UUIDToBin) WithChildren

func (ub UUIDToBin) WithChildren(children ...sql.Expression) (sql.Expression, error)

type UnaryDatetimeFunc

type UnaryDatetimeFunc struct {
	expression.UnaryExpression
	// Name is the name of the function
	Name string
	// SQLType is the return type of the function
	SQLType sql.Type
}

UnaryDatetimeFunc is a sql.Function which takes a single datetime argument

func NewUnaryDatetimeFunc

func NewUnaryDatetimeFunc(arg sql.Expression, name string, sqlType sql.Type) *UnaryDatetimeFunc

func (*UnaryDatetimeFunc) EvalChild

func (dtf *UnaryDatetimeFunc) EvalChild(ctx *sql.Context, row sql.Row) (interface{}, error)

func (*UnaryDatetimeFunc) FunctionName

func (dtf *UnaryDatetimeFunc) FunctionName() string

FunctionName implements sql.FunctionExpression

func (*UnaryDatetimeFunc) String

func (dtf *UnaryDatetimeFunc) String() string

String implements the fmt.Stringer interface.

func (*UnaryDatetimeFunc) Type

func (dtf *UnaryDatetimeFunc) Type() sql.Type

Type implements the Expression interface.

type UnaryFunc

type UnaryFunc struct {
	expression.UnaryExpression
	// Name is the name of the function
	Name string
	// The type returned by the function
	RetType sql.Type
}

func NewUnaryFunc

func NewUnaryFunc(arg sql.Expression, name string, returnType sql.Type) *UnaryFunc

func (*UnaryFunc) EvalChild

func (uf *UnaryFunc) EvalChild(ctx *sql.Context, row sql.Row) (interface{}, error)

EvalChild is a convenience function for safely evaluating a child expression

func (*UnaryFunc) FunctionName

func (uf *UnaryFunc) FunctionName() string

FunctionName implements sql.FunctionExpression

func (*UnaryFunc) String

func (uf *UnaryFunc) String() string

String implements the fmt.Stringer interface.

func (*UnaryFunc) Type

func (uf *UnaryFunc) Type() sql.Type

Type implements the Expression interface.

type Unhex

type Unhex struct {
	*UnaryFunc
}

Unhex implements the sql function "unhex" which returns the integer representation of a hexadecimal string

func (*Unhex) CollationCoercibility

func (*Unhex) CollationCoercibility(ctx *sql.Context) (collation sql.CollationID, coercibility byte)

CollationCoercibility implements the interface sql.CollationCoercible.

func (*Unhex) Description

func (h *Unhex) Description() string

Description implements sql.FunctionExpression

func (*Unhex) Eval

func (h *Unhex) Eval(ctx *sql.Context, row sql.Row) (interface{}, error)

Eval implements the sql.Expression interface

func (*Unhex) WithChildren

func (h *Unhex) WithChildren(children ...sql.Expression) (sql.Expression, error)

WithChildren implements the sql.Expression interface

type UnixTimestamp

type UnixTimestamp struct {
	Date sql.Expression
}

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) CollationCoercibility

func (*UnixTimestamp) CollationCoercibility(ctx *sql.Context) (collation sql.CollationID, coercibility byte)

CollationCoercibility implements the interface sql.CollationCoercible.

func (*UnixTimestamp) Description

func (ut *UnixTimestamp) Description() string

Description implements sql.FunctionExpression

func (*UnixTimestamp) Eval

func (ut *UnixTimestamp) Eval(ctx *sql.Context, row sql.Row) (interface{}, error)

func (*UnixTimestamp) FunctionName

func (ut *UnixTimestamp) FunctionName() string

FunctionName implements sql.FunctionExpression

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) CollationCoercibility

func (u *Upper) CollationCoercibility(ctx *sql.Context) (collation sql.CollationID, coercibility byte)

CollationCoercibility implements the interface sql.CollationCoercible.

func (*Upper) Description

func (u *Upper) Description() string

Description implements sql.FunctionExpression

func (*Upper) Eval

func (u *Upper) Eval(
	ctx *sql.Context,
	row sql.Row,
) (interface{}, error)

Eval implements the Expression interface.

func (*Upper) FunctionName

func (u *Upper) FunctionName() string

FunctionName implements sql.FunctionExpression

func (*Upper) String

func (u *Upper) String() string

func (*Upper) Type

func (u *Upper) Type() sql.Type

Type implements the Expression interface.

func (*Upper) WithChildren

func (u *Upper) WithChildren(children ...sql.Expression) (sql.Expression, error)

WithChildren implements the Expression interface.

type User

type User struct {
	NoArgFunc
}

func (User) CollationCoercibility

func (User) CollationCoercibility(ctx *sql.Context) (collation sql.CollationID, coercibility byte)

CollationCoercibility implements the interface sql.CollationCoercible.

func (User) Description

func (c User) Description() string

Description implements sql.FunctionExpression

func (User) Eval

func (c User) Eval(ctx *sql.Context, row sql.Row) (interface{}, error)

Eval implements sql.Expression

func (User) IsNonDeterministic

func (c User) IsNonDeterministic() bool

func (User) WithChildren

func (c User) WithChildren(children ...sql.Expression) (sql.Expression, error)

WithChildren implements sql.Expression

type Values

type Values struct {
	expression.UnaryExpression
	Value interface{}
}

Values is used in an ON DUPLICATE KEY UPDATE statement to return the value stated in the to-be-inserted column. For example, given the following statement: INSERT INTO table (pk, v1, v2) VALUES (1, 3, 5), (2, 4, 6) ON DUPLICATE KEY UPDATE v2 = values(v1) * 10; the values inserted into v2 would be 30 and 40.

func (*Values) CollationCoercibility

func (v *Values) CollationCoercibility(ctx *sql.Context) (collation sql.CollationID, coercibility byte)

CollationCoercibility implements the interface sql.CollationCoercible.

func (*Values) Description

func (v *Values) Description() string

Description implements sql.FunctionExpression.

func (*Values) Eval

func (v *Values) Eval(ctx *sql.Context, row sql.Row) (interface{}, error)

Eval implements sql.FunctionExpression.

func (*Values) FunctionName

func (v *Values) FunctionName() string

FunctionName implements sql.FunctionExpression.

func (*Values) String

func (v *Values) String() string

String implements sql.FunctionExpression.

func (*Values) Type

func (v *Values) Type() sql.Type

Type implements sql.FunctionExpression.

func (*Values) WithChildren

func (v *Values) WithChildren(children ...sql.Expression) (sql.Expression, error)

WithChildren implements sql.FunctionExpression.

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) CollationCoercibility

func (Version) CollationCoercibility(ctx *sql.Context) (collation sql.CollationID, coercibility byte)

CollationCoercibility implements the interface sql.CollationCoercible.

func (Version) Description

func (f Version) Description() string

Description implements sql.FunctionExpression

func (Version) Eval

func (f Version) Eval(ctx *sql.Context, row sql.Row) (interface{}, error)

Eval implements the Expression interface.

func (Version) FunctionName

func (f Version) FunctionName() string

FunctionName implements sql.FunctionExpression

func (Version) IsNonDeterministic

func (f Version) IsNonDeterministic() bool

func (Version) IsNullable

func (f Version) IsNullable() bool

IsNullable implements the Expression interface.

func (Version) Resolved

func (f Version) Resolved() bool

Resolved implements the Expression interface.

func (Version) String

func (f Version) String() string

func (Version) Type

func (f Version) Type() sql.Type

Type implements the Expression interface.

func (Version) WithChildren

func (f Version) WithChildren(children ...sql.Expression) (sql.Expression, error)

WithChildren implements the Expression interface.

type Week

type Week struct {
	// contains filtered or unexported fields
}

Week 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 (*Week) Children

func (d *Week) Children() []sql.Expression

Children implements the Expression interface.

func (*Week) CollationCoercibility

func (*Week) CollationCoercibility(ctx *sql.Context) (collation sql.CollationID, coercibility byte)

CollationCoercibility implements the interface sql.CollationCoercible.

func (*Week) Description

func (d *Week) Description() string

Description implements sql.FunctionExpression

func (*Week) Eval

func (d *Week) Eval(ctx *sql.Context, row sql.Row) (interface{}, error)

Eval implements the Expression interface.

func (*Week) FunctionName

func (d *Week) FunctionName() string

FunctionName implements sql.FunctionExpression

func (*Week) IsNullable

func (d *Week) IsNullable() bool

IsNullable implements the Expression interface.

func (*Week) Resolved

func (d *Week) Resolved() bool

Resolved implements the Expression interface.

func (*Week) String

func (d *Week) String() string

func (*Week) Type

func (d *Week) Type() sql.Type

Type implements the Expression interface.

func (*Week) WithChildren

func (*Week) WithChildren(children ...sql.Expression) (sql.Expression, error)

WithChildren implements the Expression interface.

type WeekOfYear

type WeekOfYear struct {
	*UnaryDatetimeFunc
}

WeekOfYear implements the weekofyear function

func (*WeekOfYear) CollationCoercibility

func (*WeekOfYear) CollationCoercibility(ctx *sql.Context) (collation sql.CollationID, coercibility byte)

CollationCoercibility implements the interface sql.CollationCoercible.

func (*WeekOfYear) Description

func (m *WeekOfYear) Description() string

Description implements sql.FunctionExpression

func (*WeekOfYear) Eval

func (m *WeekOfYear) Eval(ctx *sql.Context, row sql.Row) (interface{}, error)

func (*WeekOfYear) WithChildren

func (m *WeekOfYear) WithChildren(children ...sql.Expression) (sql.Expression, error)

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) CollationCoercibility

func (*Weekday) CollationCoercibility(ctx *sql.Context) (collation sql.CollationID, coercibility byte)

CollationCoercibility implements the interface sql.CollationCoercible.

func (*Weekday) Description

func (d *Weekday) Description() string

Description implements sql.FunctionExpression

func (*Weekday) Eval

func (d *Weekday) Eval(ctx *sql.Context, row sql.Row) (interface{}, error)

Eval implements the Expression interface.

func (*Weekday) FunctionName

func (d *Weekday) FunctionName() string

FunctionName implements sql.FunctionExpression

func (*Weekday) String

func (d *Weekday) String() string

func (*Weekday) Type

func (d *Weekday) Type() sql.Type

Type implements the Expression interface.

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) CollationCoercibility

func (*Year) CollationCoercibility(ctx *sql.Context) (collation sql.CollationID, coercibility byte)

CollationCoercibility implements the interface sql.CollationCoercible.

func (*Year) Description

func (y *Year) Description() string

Description implements sql.FunctionExpression

func (*Year) Eval

func (y *Year) Eval(ctx *sql.Context, row sql.Row) (interface{}, error)

Eval implements the Expression interface.

func (*Year) FunctionName

func (y *Year) FunctionName() string

FunctionName implements sql.FunctionExpression

func (*Year) String

func (y *Year) String() string

func (*Year) Type

func (y *Year) Type() sql.Type

Type implements the Expression interface.

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) CollationCoercibility

func (*YearWeek) CollationCoercibility(ctx *sql.Context) (collation sql.CollationID, coercibility byte)

CollationCoercibility implements the interface sql.CollationCoercible.

func (*YearWeek) Description

func (d *YearWeek) Description() string

Description implements sql.FunctionExpression

func (*YearWeek) Eval

func (d *YearWeek) Eval(ctx *sql.Context, row sql.Row) (interface{}, error)

Eval implements the Expression interface.

func (*YearWeek) FunctionName

func (d *YearWeek) FunctionName() string

FunctionName implements sql.FunctionExpression

func (*YearWeek) IsNullable

func (d *YearWeek) IsNullable() bool

IsNullable implements the Expression interface.

func (*YearWeek) Resolved

func (d *YearWeek) Resolved() bool

Resolved implements the Expression interface.

func (*YearWeek) String

func (d *YearWeek) String() string

func (*YearWeek) Type

func (d *YearWeek) Type() sql.Type

Type implements the Expression interface.

func (*YearWeek) WithChildren

func (*YearWeek) WithChildren(children ...sql.Expression) (sql.Expression, error)

WithChildren implements the Expression interface.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL