operator

package
v0.0.3-alpha Latest Latest
Warning

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

Go to latest
Published: Jul 15, 2020 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Binary

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

func And

func And(left, right lingo.Expression) Binary

And creates an AND operator.Binary expression

func Between

func Between(left, first, second lingo.Expression) Binary

Between creates a between operator.Binary expression, adding the And expression for the first and second values

func Eq

func Eq(left, right lingo.Expression) Binary

Eq creates an equals operator.Binary expression

func GreaterThan

func GreaterThan(left, right lingo.Expression) Binary

GreaterThan creates a greater than operator.Binary expression

func GreaterThanOrEqual

func GreaterThanOrEqual(left, right lingo.Expression) Binary

GreaterThanOrEqual creates a greater than or equal to operator.Binary expression

func In

func In(left lingo.Expression, values lingo.Expression) Binary

In creates an in operator.Binary expression

func LessThan

func LessThan(left, right lingo.Expression) Binary

LessThan creates a less than operator.Binary expression

func LessThanOrEqual

func LessThanOrEqual(left, right lingo.Expression) Binary

LessThanOrEqual creates a less than or equal to operator.Binary expression

func Like

func Like(left, right lingo.Expression) Binary

Like creates a like operator.Binary expression

func NewBinary

func NewBinary(left lingo.Expression, op Operator, right lingo.Expression) Binary

func NotBetween

func NotBetween(left, first, second lingo.Expression) Binary

NotBetween creates a not between operator.Binary expression, adding the And expression for the first and second values

func NotEq

func NotEq(left, right lingo.Expression) Binary

NotEq creates an not equal operator.Binary expression

func NotIn

func NotIn(left lingo.Expression, values lingo.Expression) Binary

NotIn creates a not in operator.Binary expression

func NotLike

func NotLike(left, right lingo.Expression) Binary

NotLike creates a not like operator.Binary expression

func Or

func Or(left, right lingo.Expression) Binary

Or creates an OR operator.Binary expression

func (Binary) And

func (Binary) Or

func (Binary) ToSQL

func (b Binary) ToSQL(d lingo.Dialect) (sql.Data, error)

type Dialect

type Dialect interface {
	UnaryOperator(left sql.Data, op Operator) (sql.Data, error)
	BinaryOperator(left sql.Data, op Operator, right sql.Data) (sql.Data, error)
	VariadicOperator(left sql.Data, op Operator, values []sql.Data) (sql.Data, error)
}

type Operator

type Operator int
const (
	OpUnknown Operator = -iota //nolint

	OpAnd
	OpOr

	OpEq
	OpNotEq
	OpLike
	OpNotLike

	OpLessThan
	OpLessThanOrEqual
	OpGreaterThan
	OpGreaterThanOrEqual

	OpNull
	OpNotNull

	OpIn
	OpNotIn

	OpBetween
	OpNotBetween
)

type Unary

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

func IsNotNull

func IsNotNull(exp lingo.Expression) Unary

IsNotNull creates a not null operator.Unary expression

func IsNull

func IsNull(exp lingo.Expression) Unary

IsNull creates an operator.Unary "null" expression (not literally a nil lingo.Expression!)

func NewUnary

func NewUnary(exp lingo.Expression, op Operator) Unary

func (Unary) ToSQL

func (u Unary) ToSQL(d lingo.Dialect) (sql.Data, error)

type Variadic

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

func NewVariadic

func NewVariadic(left lingo.Expression, op Operator, expressions []lingo.Expression) Variadic

func (Variadic) And

func (Variadic) Or

func (Variadic) ToSQL

func (o Variadic) ToSQL(d lingo.Dialect) (sql.Data, error)

Jump to

Keyboard shortcuts

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