expression

package
v0.54.7 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2025 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewIntegerLiteral added in v0.5.0

func NewIntegerLiteral(integerValue string) (*expression.Literal, error)

NewIntegerLiteral returns a new *expression.Literal containing an integer (INT2/4/8 or NUMERIC) value.

func NewIntervalLiteral added in v0.11.0

func NewIntervalLiteral(duration duration.Duration) *expression.Literal

NewIntervalLiteral returns a new *expression.Literal containing a INTERVAL value.

func NewJSONLiteral added in v0.8.0

func NewJSONLiteral(jsonValue string) *expression.Literal

NewJSONLiteral returns a new *expression.Literal containing a JSON value. This is different from JSONB.

func NewNullLiteral added in v0.7.5

func NewNullLiteral() *expression.Literal

NewNullLiteral returns a new *expression.Literal containing a null value.

func NewNumericLiteral added in v0.6.0

func NewNumericLiteral(numericValue string) (*expression.Literal, error)

NewNumericLiteral returns a new *expression.Literal containing a NUMERIC value.

func NewRawLiteralBool added in v0.7.5

func NewRawLiteralBool(val bool) *expression.Literal

NewRawLiteralBool returns a new *expression.Literal containing a boolean value.

func NewRawLiteralDate added in v0.13.0

func NewRawLiteralDate(date time.Time) *expression.Literal

NewRawLiteralDate returns a new *expression.Literal containing a DATE value.

func NewRawLiteralFloat32 added in v0.16.0

func NewRawLiteralFloat32(val float32) *expression.Literal

NewRawLiteralFloat32 returns a new *expression.Literal containing a float32 value.

func NewRawLiteralFloat64 added in v0.7.5

func NewRawLiteralFloat64(val float64) *expression.Literal

NewRawLiteralFloat64 returns a new *expression.Literal containing a float64 value.

func NewRawLiteralInt32 added in v0.16.0

func NewRawLiteralInt32(val int32) *expression.Literal

NewRawLiteralInt32 returns a new *expression.Literal containing an int32 value.

func NewRawLiteralInt64 added in v0.7.5

func NewRawLiteralInt64(val int64) *expression.Literal

NewRawLiteralInt64 returns a new *expression.Literal containing an int64 value.

func NewRawLiteralJSON added in v0.13.0

func NewRawLiteralJSON(val string) *expression.Literal

NewRawLiteralJSON returns a new *expression.Literal containing a JSON value.

func NewRawLiteralNumeric added in v0.7.5

func NewRawLiteralNumeric(val decimal.Decimal) *expression.Literal

NewRawLiteralNumeric returns a new *expression.Literal containing a decimal.Decimal value.

func NewRawLiteralOid added in v0.13.0

func NewRawLiteralOid(val id.Id) *expression.Literal

NewRawLiteralOid returns a new *expression.Literal containing a OID value.

func NewRawLiteralTime added in v0.13.0

func NewRawLiteralTime(t time.Time) *expression.Literal

NewRawLiteralTime returns a new *expression.Literal containing a TIME value.

func NewRawLiteralTimeTZ added in v0.13.0

func NewRawLiteralTimeTZ(ttz time.Time) *expression.Literal

NewRawLiteralTimeTZ returns a new *expression.Literal containing a TIMETZ value.

func NewRawLiteralTimestamp added in v0.7.5

func NewRawLiteralTimestamp(val time.Time) *expression.Literal

NewRawLiteralTimestamp returns a new *expression.Literal containing a TIMESTAMP value. This is the variant without a time zone.

func NewRawLiteralTimestampTZ added in v0.13.0

func NewRawLiteralTimestampTZ(val time.Time) *expression.Literal

NewRawLiteralTimestampTZ returns a new *expression.Literal containing a TIMESTAMPTZ value. This is the variant with a time zone.

func NewRawLiteralUuid added in v0.13.0

func NewRawLiteralUuid(val uuid.UUID) *expression.Literal

NewRawLiteralUuid returns a new *expression.Literal containing a UUID value.

func NewTableToComposite added in v0.54.6

func NewTableToComposite(ctx *sql.Context, tableName string, fields []sql.Expression) (sql.Expression, error)

NewTableToComposite creates a new composite table type.

func NewTextLiteral added in v0.11.1

func NewTextLiteral(stringValue string) *expression.Literal

NewTextLiteral returns a new *expression.Literal containing a TEXT type value. This should be used for internal uses when the type of the value is certain.

func NewUnknownLiteral added in v0.11.1

func NewUnknownLiteral(stringValue string) *expression.Literal

NewUnknownLiteral returns a new *expression.Literal containing a UNKNOWN type value.

func NewUnsafeLiteral added in v0.11.0

func NewUnsafeLiteral(val any, t *pgtypes.DoltgresType) *expression.Literal

NewUnsafeLiteral returns a new *expression.Literal containing the given value and type. This should almost never be used, as it does not perform any checking and circumvents type safety, which may lead to hard-to-debug errors. This is currently only used within the analyzer, and will likely be removed in the future.

func ToVitessLiteral added in v0.50.1

func ToVitessLiteral(l *expression.Literal) *vitess.SQLVal

ToVitessLiteral returns the literal as a Vitess literal. This is strictly for situations where GMS is hardcoded to expect a Vitess literal. This should only be used as a temporary measure, as the GMS code needs to be updated, or the equivalent functionality should be built into Doltgres (recommend the second approach).

Types

type AnyExpr added in v0.11.0

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

AnyExpr represents the ANY/SOME expression.

func NewAnyExpr added in v0.11.0

func NewAnyExpr(subOperator string) *AnyExpr

NewAnyExpr creates a new AnyExpr expression.

func NewSomeExpr added in v0.11.0

func NewSomeExpr(subOperator string) *AnyExpr

NewSomeExpr creates a new AnyExpr expression for SOME. SOME is synonymous with ANY.

func (*AnyExpr) Children added in v0.11.0

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

Children implements the Expression interface.

func (*AnyExpr) DebugString added in v0.11.0

func (a *AnyExpr) DebugString() string

DebugString implements the Expression interface.

func (*AnyExpr) Eval added in v0.11.0

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

Eval implements the Expression interface.

func (*AnyExpr) IsNullable added in v0.11.0

func (a *AnyExpr) IsNullable() bool

IsNullable implements the Expression interface.

func (*AnyExpr) Resolved added in v0.11.0

func (a *AnyExpr) Resolved() bool

Resolved implements the Expression interface.

func (*AnyExpr) String added in v0.11.0

func (a *AnyExpr) String() string

String implements the fmt.Stringer interface.

func (*AnyExpr) Type added in v0.11.0

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

Type implements the Expression interface.

func (*AnyExpr) WithChildren added in v0.11.0

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

WithChildren implements the Expression interface.

func (*AnyExpr) WithResolvedChildren added in v0.11.0

func (a *AnyExpr) WithResolvedChildren(children []any) (any, error)

WithResolvedChildren implements the Expression interface.

type Array

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

Array represents an ARRAY[...] expression.

func NewArray

func NewArray(coercedType sql.Type) (*Array, error)

NewArray returns a new *Array.

func (*Array) Children

func (array *Array) Children() []sql.Expression

Children implements the sql.Expression interface.

func (*Array) Eval

func (array *Array) Eval(ctx *sql.Context, row sql.Row) (any, error)

Eval implements the sql.Expression interface.

func (*Array) IsNullable

func (array *Array) IsNullable() bool

IsNullable implements the sql.Expression interface.

func (*Array) Resolved

func (array *Array) Resolved() bool

Resolved implements the sql.Expression interface.

func (*Array) String

func (array *Array) String() string

String implements the sql.Expression interface.

func (*Array) Type

func (array *Array) Type() sql.Type

Type implements the sql.Expression interface.

func (*Array) WithChildren

func (array *Array) WithChildren(children ...sql.Expression) (sql.Expression, error)

WithChildren implements the sql.Expression interface.

func (*Array) WithResolvedChildren

func (array *Array) WithResolvedChildren(children []any) (any, error)

WithResolvedChildren implements the vitess.InjectableExpression interface.

type ArrayAgg added in v0.51.0

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

func (*ArrayAgg) Children added in v0.51.0

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

Children implements sql.Expression

func (*ArrayAgg) Eval added in v0.51.0

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

Eval implements sql.Expression

func (*ArrayAgg) Id added in v0.51.0

func (a *ArrayAgg) Id() sql.ColumnId

Id implements sql.IdExpression

func (*ArrayAgg) IsNullable added in v0.51.0

func (a *ArrayAgg) IsNullable() bool

IsNullable implements sql.Expression

func (*ArrayAgg) NewBuffer added in v0.51.0

func (a *ArrayAgg) NewBuffer() (sql.AggregationBuffer, error)

NewBuffer implements sql.Aggregation

func (*ArrayAgg) NewWindowFunction added in v0.51.0

func (a *ArrayAgg) NewWindowFunction() (sql.WindowFunction, error)

NewWindowFunction implements sql.WindowAdaptableExpression

func (*ArrayAgg) OutputExpressions added in v0.51.0

func (a *ArrayAgg) OutputExpressions() []sql.Expression

func (*ArrayAgg) Resolved added in v0.51.0

func (a *ArrayAgg) Resolved() bool

Resolved implements sql.Expression

func (*ArrayAgg) String added in v0.51.0

func (a *ArrayAgg) String() string

String implements sql.Expression

func (*ArrayAgg) Type added in v0.51.0

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

Type implements sql.Expression

func (*ArrayAgg) Window added in v0.51.0

func (a *ArrayAgg) Window() *sql.WindowDefinition

Window implements sql.WindowAdaptableExpression

func (ArrayAgg) WithChildren added in v0.51.0

func (a ArrayAgg) WithChildren(children ...sql.Expression) (sql.Expression, error)

WithChildren implements sql.Expression

func (ArrayAgg) WithId added in v0.51.0

func (a ArrayAgg) WithId(id sql.ColumnId) sql.IdExpression

WithId implements sql.IdExpression

func (*ArrayAgg) WithResolvedChildren added in v0.51.0

func (a *ArrayAgg) WithResolvedChildren(children []any) (any, error)

WithResolvedChildren returns a new ArrayAgg with the provided children as its select expressions. The last child is expected to be the order by expressions.

func (*ArrayAgg) WithWindow added in v0.51.0

WithWindow implements sql.WindowAdaptableExpression

type ArrayFlatten added in v0.50.0

type ArrayFlatten struct {
	Subquery sql.Expression
}

ArrayFlatten is an expression that represents the results of a subquery expression as an array. Currently only subqueries that return a single column are supported.

func (ArrayFlatten) Children added in v0.50.0

func (a ArrayFlatten) Children() []sql.Expression

Children implements sql.Expression.

func (ArrayFlatten) Eval added in v0.50.0

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

Eval implements sql.Expression.

func (ArrayFlatten) IsNullable added in v0.50.0

func (a ArrayFlatten) IsNullable() bool

IsNullable implements sql.Expression.

func (ArrayFlatten) Resolved added in v0.50.0

func (a ArrayFlatten) Resolved() bool

Resolved implements sql.Expression.

func (ArrayFlatten) String added in v0.50.0

func (a ArrayFlatten) String() string

String implements sql.Expression.

func (ArrayFlatten) Type added in v0.50.0

func (a ArrayFlatten) Type() sql.Type

Type implements sql.Expression.

func (ArrayFlatten) WithChildren added in v0.50.0

func (a ArrayFlatten) WithChildren(children ...sql.Expression) (sql.Expression, error)

WithChildren implements sql.Expression.

func (ArrayFlatten) WithResolvedChildren added in v0.50.0

func (a ArrayFlatten) WithResolvedChildren(children []any) (any, error)

WithResolvedChildren implements vitess.Injectable.

type AssignmentCast added in v0.8.0

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

AssignmentCast handles assignment casts.

func NewAssignmentCast added in v0.8.0

func NewAssignmentCast(expr sql.Expression, fromType *pgtypes.DoltgresType, toType *pgtypes.DoltgresType) *AssignmentCast

NewAssignmentCast returns a new *AssignmentCast expression.

func (*AssignmentCast) Children added in v0.8.0

func (ac *AssignmentCast) Children() []sql.Expression

Children implements the sql.Expression interface.

func (*AssignmentCast) Eval added in v0.8.0

func (ac *AssignmentCast) Eval(ctx *sql.Context, row sql.Row) (any, error)

Eval implements the sql.Expression interface.

func (*AssignmentCast) IsNullable added in v0.8.0

func (ac *AssignmentCast) IsNullable() bool

IsNullable implements the sql.Expression interface.

func (*AssignmentCast) Resolved added in v0.8.0

func (ac *AssignmentCast) Resolved() bool

Resolved implements the sql.Expression interface.

func (*AssignmentCast) String added in v0.8.0

func (ac *AssignmentCast) String() string

String implements the sql.Expression interface.

func (*AssignmentCast) Type added in v0.8.0

func (ac *AssignmentCast) Type() sql.Type

Type implements the sql.Expression interface.

func (*AssignmentCast) WithChildren added in v0.8.0

func (ac *AssignmentCast) WithChildren(children ...sql.Expression) (sql.Expression, error)

WithChildren implements the sql.Expression interface.

type BinaryOperator added in v0.5.0

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

BinaryOperator represents a VALUE OPERATOR VALUE expression.

func NewBinaryOperator added in v0.5.0

func NewBinaryOperator(operator framework.Operator) *BinaryOperator

NewBinaryOperator returns a new *BinaryOperator.

func (*BinaryOperator) Children added in v0.5.0

func (b *BinaryOperator) Children() []sql.Expression

Children implements the sql.Expression interface.

func (*BinaryOperator) Eval added in v0.5.0

func (b *BinaryOperator) Eval(ctx *sql.Context, row sql.Row) (any, error)

Eval implements the sql.Expression interface.

func (*BinaryOperator) IndexScanOperation added in v0.52.0

func (b *BinaryOperator) IndexScanOperation() (sql.IndexScanOp, sql.Expression, sql.Expression, bool)

IndexScanOperation implements the sql.IndexComparisonExpression interface.

func (*BinaryOperator) IsNullable added in v0.5.0

func (b *BinaryOperator) IsNullable() bool

IsNullable implements the sql.Expression interface.

func (*BinaryOperator) Left added in v0.5.0

func (b *BinaryOperator) Left() sql.Expression

Left implements the expression.BinaryExpression interface.

func (*BinaryOperator) Operator added in v0.10.0

func (b *BinaryOperator) Operator() framework.Operator

Operator returns the operator that is used.

func (*BinaryOperator) RepresentsEquality added in v0.12.0

func (b *BinaryOperator) RepresentsEquality() bool

RepresentsEquality implements the expression.Equality interface.

func (*BinaryOperator) Resolved added in v0.5.0

func (b *BinaryOperator) Resolved() bool

Resolved implements the sql.Expression interface.

func (*BinaryOperator) Right added in v0.5.0

func (b *BinaryOperator) Right() sql.Expression

Right implements the expression.BinaryExpression interface.

func (*BinaryOperator) String added in v0.5.0

func (b *BinaryOperator) String() string

String implements the sql.Expression interface.

func (*BinaryOperator) SwapParameters added in v0.12.0

func (b *BinaryOperator) SwapParameters(ctx *sql.Context) (expression.Equality, error)

SwapParameters implements the expression.Equality interface.

func (*BinaryOperator) ToComparer added in v0.12.0

func (b *BinaryOperator) ToComparer() (expression.Comparer, error)

ToComparer implements the expression.Equality interface.

func (*BinaryOperator) Type added in v0.5.0

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

Type implements the sql.Expression interface.

func (*BinaryOperator) WithChildren added in v0.5.0

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

WithChildren implements the sql.Expression interface.

func (*BinaryOperator) WithResolvedChildren added in v0.5.0

func (b *BinaryOperator) WithResolvedChildren(children []any) (any, error)

WithResolvedChildren implements the vitess.InjectableExpression interface.

type ExplicitCast added in v0.8.0

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

ExplicitCast represents a VALUE::TYPE expression.

func NewExplicitCast added in v0.8.0

func NewExplicitCast(expr sql.Expression, toType *pgtypes.DoltgresType) *ExplicitCast

NewExplicitCast returns a new *ExplicitCast expression.

func NewExplicitCastInjectable added in v0.10.0

func NewExplicitCastInjectable(castToType sql.Type) (*ExplicitCast, error)

NewExplicitCastInjectable returns an incomplete *ExplicitCast that must be resolved through the vitess.Injectable interface.

func (*ExplicitCast) Child added in v0.8.0

func (c *ExplicitCast) Child() sql.Expression

Child returns the child that is being cast.

func (*ExplicitCast) Children added in v0.8.0

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

Children implements the sql.Expression interface.

func (*ExplicitCast) Eval added in v0.8.0

func (c *ExplicitCast) Eval(ctx *sql.Context, row sql.Row) (any, error)

Eval implements the sql.Expression interface.

func (*ExplicitCast) IsNullable added in v0.8.0

func (c *ExplicitCast) IsNullable() bool

IsNullable implements the sql.Expression interface.

func (*ExplicitCast) Resolved added in v0.8.0

func (c *ExplicitCast) Resolved() bool

Resolved implements the sql.Expression interface.

func (*ExplicitCast) String added in v0.8.0

func (c *ExplicitCast) String() string

String implements the sql.Expression interface.

func (*ExplicitCast) Type added in v0.8.0

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

Type implements the sql.Expression interface.

func (*ExplicitCast) WithCastToType added in v0.16.0

func (c *ExplicitCast) WithCastToType(t *pgtypes.DoltgresType) sql.Expression

WithCastToType returns a copy of the expression with castToType replaced.

func (*ExplicitCast) WithChildren added in v0.8.0

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

WithChildren implements the sql.Expression interface.

func (*ExplicitCast) WithDomainConstraints added in v0.16.0

func (c *ExplicitCast) WithDomainConstraints(nullable bool, checks sql.CheckConstraints) sql.Expression

WithDomainConstraints returns a copy of the expression with domain constraints defined.

func (*ExplicitCast) WithResolvedChildren added in v0.8.0

func (c *ExplicitCast) WithResolvedChildren(children []any) (any, error)

WithResolvedChildren implements the vitess.InjectableExpression interface.

type GMSCast added in v0.8.0

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

GMSCast handles the conversion from a GMS expression's type to its Doltgres type that is most similar.

func NewGMSCast added in v0.8.0

func NewGMSCast(child sql.Expression) *GMSCast

NewGMSCast returns a new *GMSCast.

func (*GMSCast) Child added in v0.8.0

func (c *GMSCast) Child() sql.Expression

Child returns the child that is being cast.

func (*GMSCast) Children added in v0.8.0

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

Children implements the sql.Expression interface.

func (*GMSCast) DoltgresType added in v0.8.0

func (c *GMSCast) DoltgresType() *pgtypes.DoltgresType

DoltgresType returns the DoltgresType that the cast evaluates to. This is the same value that is returned by Type().

func (*GMSCast) Eval added in v0.8.0

func (c *GMSCast) Eval(ctx *sql.Context, row sql.Row) (any, error)

Eval implements the sql.Expression interface.

func (*GMSCast) IsNullable added in v0.8.0

func (c *GMSCast) IsNullable() bool

IsNullable implements the sql.Expression interface.

func (*GMSCast) Resolved added in v0.8.0

func (c *GMSCast) Resolved() bool

Resolved implements the sql.Expression interface.

func (*GMSCast) String added in v0.8.0

func (c *GMSCast) String() string

String implements the sql.Expression interface.

func (*GMSCast) Type added in v0.8.0

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

Type implements the sql.Expression interface.

func (*GMSCast) WithChildren added in v0.8.0

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

WithChildren implements the sql.Expression interface.

type ImplicitCast added in v0.8.0

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

ImplicitCast handles implicit casts.

func NewImplicitCast added in v0.8.0

func NewImplicitCast(expr sql.Expression, fromType *pgtypes.DoltgresType, toType *pgtypes.DoltgresType) *ImplicitCast

NewImplicitCast returns a new *ImplicitCast expression.

func (*ImplicitCast) Children added in v0.8.0

func (ic *ImplicitCast) Children() []sql.Expression

Children implements the sql.Expression interface.

func (*ImplicitCast) Eval added in v0.8.0

func (ic *ImplicitCast) Eval(ctx *sql.Context, row sql.Row) (any, error)

Eval implements the sql.Expression interface.

func (*ImplicitCast) IsNullable added in v0.8.0

func (ic *ImplicitCast) IsNullable() bool

IsNullable implements the sql.Expression interface.

func (*ImplicitCast) Resolved added in v0.8.0

func (ic *ImplicitCast) Resolved() bool

Resolved implements the sql.Expression interface.

func (*ImplicitCast) String added in v0.8.0

func (ic *ImplicitCast) String() string

String implements the sql.Expression interface.

func (*ImplicitCast) Type added in v0.8.0

func (ic *ImplicitCast) Type() sql.Type

Type implements the sql.Expression interface.

func (*ImplicitCast) WithChildren added in v0.8.0

func (ic *ImplicitCast) WithChildren(children ...sql.Expression) (sql.Expression, error)

WithChildren implements the sql.Expression interface.

type InSubquery added in v0.11.1

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

InSubquery represents a VALUE IN (SELECT ...) expression.

func NewInSubquery added in v0.11.1

func NewInSubquery() *InSubquery

NewInSubquery returns a new *InSubquery.

func (*InSubquery) Children added in v0.11.1

func (in *InSubquery) Children() []sql.Expression

Children implements the sql.Expression interface.

func (*InSubquery) Eval added in v0.11.1

func (in *InSubquery) Eval(ctx *sql.Context, row sql.Row) (any, error)

Eval implements the sql.Expression interface.

func (*InSubquery) IsNullable added in v0.11.1

func (in *InSubquery) IsNullable() bool

IsNullable implements the sql.Expression interface.

func (*InSubquery) Left added in v0.11.1

func (in *InSubquery) Left() sql.Expression

Left implements the expression.BinaryExpression interface.

func (*InSubquery) Resolved added in v0.11.1

func (in *InSubquery) Resolved() bool

Resolved implements the sql.Expression interface.

func (*InSubquery) Right added in v0.11.1

func (in *InSubquery) Right() sql.Expression

Right implements the expression.BinaryExpression interface.

func (*InSubquery) String added in v0.11.1

func (in *InSubquery) String() string

String implements the sql.Expression interface.

func (*InSubquery) Type added in v0.11.1

func (in *InSubquery) Type() sql.Type

Type implements the sql.Expression interface.

func (*InSubquery) WithChildren added in v0.11.1

func (in *InSubquery) WithChildren(children ...sql.Expression) (sql.Expression, error)

WithChildren implements the sql.Expression interface.

func (*InSubquery) WithResolvedChildren added in v0.11.1

func (in *InSubquery) WithResolvedChildren(children []any) (any, error)

WithResolvedChildren implements the vitess.InjectableExpression interface.

type InTuple added in v0.8.0

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

InTuple represents a VALUE IN (<VALUES>) expression.

func NewInTuple added in v0.8.0

func NewInTuple() *InTuple

NewInTuple returns a new *InTuple.

func (*InTuple) Children added in v0.8.0

func (it *InTuple) Children() []sql.Expression

Children implements the sql.Expression interface.

func (*InTuple) Decay added in v0.12.0

func (it *InTuple) Decay() sql.Expression

Decay returns the expression as a series of OR expressions. The behavior is not the same, however it allows some paths to simplify their expression handling (such as filters).

func (*InTuple) Eval added in v0.8.0

func (it *InTuple) Eval(ctx *sql.Context, row sql.Row) (any, error)

Eval implements the sql.Expression interface.

func (*InTuple) IndexScanOperation added in v0.52.0

func (it *InTuple) IndexScanOperation() (sql.IndexScanOp, sql.Expression, sql.Expression, bool)

IndexScanOperation implements the sql.IndexComparisonExpression interface.

func (*InTuple) IsNullable added in v0.8.0

func (it *InTuple) IsNullable() bool

IsNullable implements the sql.Expression interface.

func (*InTuple) Left added in v0.8.0

func (it *InTuple) Left() sql.Expression

Left implements the expression.BinaryExpression interface.

func (*InTuple) Resolved added in v0.8.0

func (it *InTuple) Resolved() bool

Resolved implements the sql.Expression interface.

func (*InTuple) Right added in v0.8.0

func (it *InTuple) Right() sql.Expression

Right implements the expression.BinaryExpression interface.

func (*InTuple) String added in v0.8.0

func (it *InTuple) String() string

String implements the sql.Expression interface.

func (*InTuple) Type added in v0.8.0

func (it *InTuple) Type() sql.Type

Type implements the sql.Expression interface.

func (*InTuple) WithChildren added in v0.8.0

func (it *InTuple) WithChildren(children ...sql.Expression) (sql.Expression, error)

WithChildren implements the sql.Expression interface.

func (*InTuple) WithResolvedChildren added in v0.8.0

func (it *InTuple) WithResolvedChildren(children []any) (any, error)

WithResolvedChildren implements the vitess.InjectableExpression interface.

type IsNotNull added in v0.51.0

type IsNotNull struct {
	expression.UnaryExpressionStub
}

IsNotNull is an implementation of sql.Expression for the IS NOT NULL operator and includes Postgres-specific logic for handling records and composites.

func NewIsNotNull added in v0.51.0

func NewIsNotNull(child sql.Expression) *IsNotNull

NewIsNotNull creates a new IsNotNull expression.

func (*IsNotNull) CollationCoercibility added in v0.51.0

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

CollationCoercibility implements the interface sql.CollationCoercible.

func (*IsNotNull) DebugString added in v0.51.0

func (e *IsNotNull) DebugString() string

func (*IsNotNull) Eval added in v0.51.0

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

Eval implements the Expression interface.

func (*IsNotNull) IsNotNullExpression added in v0.51.0

func (e *IsNotNull) IsNotNullExpression() bool

IsNotNullExpression implements the sql.IsNotNullExpression interface. This function exists primarily to ensure the IsNotNullExpression interface has a unique signature.

func (*IsNotNull) IsNullable added in v0.51.0

func (e *IsNotNull) IsNullable() bool

IsNullable implements the Expression interface.

func (*IsNotNull) String added in v0.51.0

func (e *IsNotNull) String() string

func (*IsNotNull) Type added in v0.51.0

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

Type implements the Expression interface.

func (*IsNotNull) WithChildren added in v0.51.0

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

WithChildren implements the Expression interface.

type IsNull added in v0.51.0

type IsNull struct {
	expression.UnaryExpressionStub
}

IsNull is an implementation of sql.Expression for the IS NULL operator and includes Postgres-specific logic for handling records and composites.

func NewIsNull added in v0.51.0

func NewIsNull(child sql.Expression) *IsNull

NewIsNull creates a new IsNull expression.

func (*IsNull) CollationCoercibility added in v0.51.0

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

CollationCoercibility implements the interface sql.CollationCoercible.

func (*IsNull) DebugString added in v0.51.0

func (e *IsNull) DebugString() string

func (*IsNull) Eval added in v0.51.0

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

Eval implements the Expression interface.

func (*IsNull) IsNullExpression added in v0.51.0

func (e *IsNull) IsNullExpression() bool

IsNullExpression implements the sql.IsNullExpression interface. This function exists primarily to ensure the IsNullExpression interface has a unique signature.

func (*IsNull) IsNullable added in v0.51.0

func (e *IsNull) IsNullable() bool

IsNullable implements the Expression interface.

func (*IsNull) String added in v0.51.0

func (e *IsNull) String() string

func (*IsNull) Type added in v0.51.0

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

Type implements the Expression interface.

func (*IsNull) WithChildren added in v0.51.0

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

WithChildren implements the Expression interface.

type JoinComparator added in v0.12.0

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

JoinComparator is specifically for handling how GMS implements joins by implementing expression.Comparer over binary operators.

func NewJoinComparator added in v0.12.0

func NewJoinComparator(eq *BinaryOperator) (*JoinComparator, error)

NewJoinComparator returns a new *JoinComparator.

func (*JoinComparator) Children added in v0.12.0

func (j *JoinComparator) Children() []sql.Expression

Children implements the sql.Expression interface.

func (*JoinComparator) Compare added in v0.12.0

func (j *JoinComparator) Compare(ctx *sql.Context, row sql.Row) (int, error)

Compare implements the expression.Comparer interface.

func (*JoinComparator) Eval added in v0.12.0

func (j *JoinComparator) Eval(ctx *sql.Context, row sql.Row) (any, error)

Eval implements the sql.Expression interface.

func (*JoinComparator) IsNullable added in v0.12.0

func (j *JoinComparator) IsNullable() bool

IsNullable implements the sql.Expression interface.

func (*JoinComparator) Left added in v0.12.0

func (j *JoinComparator) Left() sql.Expression

Left implements the expression.BinaryExpression interface.

func (*JoinComparator) RepresentsEquality added in v0.12.0

func (j *JoinComparator) RepresentsEquality() bool

RepresentsEquality implements the expression.Equality interface.

func (*JoinComparator) Resolved added in v0.12.0

func (j *JoinComparator) Resolved() bool

Resolved implements the sql.Expression interface.

func (*JoinComparator) Right added in v0.12.0

func (j *JoinComparator) Right() sql.Expression

Right implements the expression.BinaryExpression interface.

func (*JoinComparator) String added in v0.12.0

func (j *JoinComparator) String() string

String implements the sql.Expression interface.

func (*JoinComparator) SwapParameters added in v0.12.0

func (j *JoinComparator) SwapParameters(ctx *sql.Context) (expression.Equality, error)

SwapParameters implements the expression.Equality interface.

func (*JoinComparator) ToComparer added in v0.12.0

func (j *JoinComparator) ToComparer() (expression.Comparer, error)

ToComparer implements the expression.Equality interface.

func (*JoinComparator) Type added in v0.12.0

func (j *JoinComparator) Type() sql.Type

Type implements the sql.Expression interface.

func (*JoinComparator) WithChildren added in v0.12.0

func (j *JoinComparator) WithChildren(children ...sql.Expression) (sql.Expression, error)

WithChildren implements the sql.Expression interface.

type Not added in v0.10.0

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

Not represents a NOT expression.

func NewNot added in v0.10.0

func NewNot() *Not

NewNot returns a new *Not.

func (*Not) Children added in v0.10.0

func (n *Not) Children() []sql.Expression

Children implements the sql.Expression interface.

func (*Not) Eval added in v0.10.0

func (n *Not) Eval(ctx *sql.Context, row sql.Row) (any, error)

Eval implements the sql.Expression interface.

func (*Not) IndexScanOperation added in v0.54.6

func (n *Not) IndexScanOperation() (sql.IndexScanOp, sql.Expression, sql.Expression, bool)

IndexScanOperation implements the sql.IndexComparisonExpression interface.

func (*Not) IsNullable added in v0.10.0

func (n *Not) IsNullable() bool

IsNullable implements the sql.Expression interface.

func (*Not) Resolved added in v0.10.0

func (n *Not) Resolved() bool

Resolved implements the sql.Expression interface.

func (*Not) String added in v0.10.0

func (n *Not) String() string

String implements the sql.Expression interface.

func (*Not) Type added in v0.10.0

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

Type implements the sql.Expression interface.

func (*Not) WithChildren added in v0.10.0

func (n *Not) WithChildren(children ...sql.Expression) (sql.Expression, error)

WithChildren implements the sql.Expression interface.

func (*Not) WithResolvedChildren added in v0.10.0

func (n *Not) WithResolvedChildren(children []any) (any, error)

WithResolvedChildren implements the vitess.InjectableExpression interface.

type PostgresExpressionFactory added in v0.51.0

type PostgresExpressionFactory struct{}

PostgresExpressionFactory implements the expression.ExpressionFactory interface and allows callers to produce expressions that have custom behavior for Postgres.

func (PostgresExpressionFactory) NewIsNotNull added in v0.51.0

NewIsNotNull implements the expression.ExpressionFactory interface.

func (PostgresExpressionFactory) NewIsNull added in v0.51.0

NewIsNull implements the expression.ExpressionFactory interface.

type RecordExpr added in v0.51.0

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

RecordExpr is a set of sql.Expressions wrapped together in a single value.

func NewRecordExpr added in v0.51.0

func NewRecordExpr() *RecordExpr

NewRecordExpr creates a new record expression.

func (*RecordExpr) Children added in v0.51.0

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

Children implements the sql.Expression interface.

func (*RecordExpr) Eval added in v0.51.0

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

Eval implements the sql.Expression interface.

func (*RecordExpr) IsNullable added in v0.51.0

func (t *RecordExpr) IsNullable() bool

IsNullable implements the sql.Expression interface.

func (*RecordExpr) Resolved added in v0.51.0

func (t *RecordExpr) Resolved() bool

Resolved implements the sql.Expression interface.

func (*RecordExpr) String added in v0.51.0

func (t *RecordExpr) String() string

String implements the sql.Expression interface.

func (*RecordExpr) Type added in v0.51.0

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

Type implements the sql.Expression interface.

func (*RecordExpr) WithChildren added in v0.51.0

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

WithChildren implements the sql.Expression interface.

func (*RecordExpr) WithResolvedChildren added in v0.51.0

func (t *RecordExpr) WithResolvedChildren(children []any) (any, error)

WithResolvedChildren implements the vitess.Injectable interface

type StatementRunner added in v0.50.1

type StatementRunner struct {
	Runner sql.StatementRunner
}

StatementRunner is an expression that can be added to a node to grab the statement runner.

func (StatementRunner) Children added in v0.50.1

func (StatementRunner) Children() []sql.Expression

Children implements the sql.Expression interface.

func (StatementRunner) Eval added in v0.50.1

func (StatementRunner) Eval(ctx *sql.Context, row sql.Row) (any, error)

Eval implements the sql.Expression interface.

func (StatementRunner) IsNullable added in v0.50.1

func (StatementRunner) IsNullable() bool

IsNullable implements the sql.Expression interface.

func (StatementRunner) Resolved added in v0.50.1

func (StatementRunner) Resolved() bool

Resolved implements the sql.Expression interface.

func (StatementRunner) SetStatementRunner added in v0.50.1

func (sr StatementRunner) SetStatementRunner(ctx *sql.Context, runner sql.StatementRunner) sql.Expression

SetStatementRunner implements the sql.Expression interface.

func (StatementRunner) String added in v0.50.1

func (StatementRunner) String() string

String implements the sql.Expression interface.

func (StatementRunner) Type added in v0.50.1

func (StatementRunner) Type() sql.Type

Type implements the sql.Expression interface.

func (StatementRunner) WithChildren added in v0.50.1

func (sr StatementRunner) WithChildren(children ...sql.Expression) (sql.Expression, error)

WithChildren implements the sql.Expression interface.

type Subscript added in v0.50.0

type Subscript struct {
	Child sql.Expression
	Index sql.Expression
}

Subscript represents a subscript expression, e.g. `a[1]`.

func NewSubscript added in v0.50.0

func NewSubscript(child, index sql.Expression) *Subscript

NewSubscript creates a new Subscript expression.

func (Subscript) Children added in v0.50.0

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

Children implements the sql.Expression interface.

func (Subscript) Eval added in v0.50.0

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

Eval implements the sql.Expression interface.

func (Subscript) IsNullable added in v0.50.0

func (s Subscript) IsNullable() bool

IsNullable implements the sql.Expression interface.

func (Subscript) Resolved added in v0.50.0

func (s Subscript) Resolved() bool

Resolved implements the sql.Expression interface.

func (Subscript) String added in v0.50.0

func (s Subscript) String() string

String implements the sql.Expression interface.

func (Subscript) Type added in v0.50.0

func (s Subscript) Type() sql.Type

Type implements the sql.Expression interface.

func (Subscript) WithChildren added in v0.50.0

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

WithChildren implements the sql.Expression interface.

func (Subscript) WithResolvedChildren added in v0.50.0

func (s Subscript) WithResolvedChildren(children []any) (any, error)

WithResolvedChildren implements the vitess.Injectable interface.

type TableToComposite added in v0.54.6

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

TableToComposite is a set of sql.Expressions wrapped together in a single value.

func (*TableToComposite) Children added in v0.54.6

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

Children implements the sql.Expression interface.

func (*TableToComposite) Eval added in v0.54.6

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

Eval implements the sql.Expression interface.

func (*TableToComposite) IsNullable added in v0.54.6

func (t *TableToComposite) IsNullable() bool

IsNullable implements the sql.Expression interface.

func (*TableToComposite) Resolved added in v0.54.6

func (t *TableToComposite) Resolved() bool

Resolved implements the sql.Expression interface.

func (*TableToComposite) String added in v0.54.6

func (t *TableToComposite) String() string

String implements the sql.Expression interface.

func (*TableToComposite) Type added in v0.54.6

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

Type implements the sql.Expression interface.

func (*TableToComposite) WithChildren added in v0.54.6

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

WithChildren implements the sql.Expression interface.

type UnaryOperator added in v0.5.0

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

UnaryOperator represents a VALUE OPERATOR VALUE expression.

func NewUnaryOperator added in v0.5.0

func NewUnaryOperator(operator framework.Operator) *UnaryOperator

NewUnaryOperator returns a new *UnaryOperator.

func (*UnaryOperator) Children added in v0.5.0

func (b *UnaryOperator) Children() []sql.Expression

Children implements the sql.Expression interface.

func (*UnaryOperator) Eval added in v0.5.0

func (b *UnaryOperator) Eval(ctx *sql.Context, row sql.Row) (any, error)

Eval implements the sql.Expression interface.

func (*UnaryOperator) IsNullable added in v0.5.0

func (b *UnaryOperator) IsNullable() bool

IsNullable implements the sql.Expression interface.

func (*UnaryOperator) Resolved added in v0.5.0

func (b *UnaryOperator) Resolved() bool

Resolved implements the sql.Expression interface.

func (*UnaryOperator) String added in v0.5.0

func (b *UnaryOperator) String() string

String implements the sql.Expression interface.

func (*UnaryOperator) Type added in v0.5.0

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

Type implements the sql.Expression interface.

func (*UnaryOperator) WithChildren added in v0.5.0

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

WithChildren implements the sql.Expression interface.

func (*UnaryOperator) WithResolvedChildren added in v0.5.0

func (b *UnaryOperator) WithResolvedChildren(children []any) (any, error)

WithResolvedChildren implements the vitess.InjectableExpression interface.

Jump to

Keyboard shortcuts

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