expression

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Direction

type Direction string
const (
	Ascending  Direction = "ASC"
	Descending Direction = "DESC"
)

type GroupBy

type GroupBy struct {
	Table  string
	Column string
}

func NewGroupBy

func NewGroupBy(column string) *GroupBy

func NewGroupWithTable

func NewGroupWithTable(table, column string) *GroupBy

func (*GroupBy) GroupBy

func (g *GroupBy) GroupBy() string

func (*GroupBy) QueryMod

func (g *GroupBy) QueryMod() []qm.QueryMod

func (*GroupBy) ToString

func (g *GroupBy) ToString() string

type Limit

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

func NewLimit

func NewLimit(value int) *Limit

func NewLimitFrom

func NewLimitFrom(expr string) ([]*Limit, error)

func (*Limit) Limit

func (l *Limit) Limit() int

func (*Limit) QueryMod

func (l *Limit) QueryMod() []qm.QueryMod

func (*Limit) ToString

func (l *Limit) ToString() string

type Offset

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

func NewOffset

func NewOffset(value int) *Offset

func NewOffsetFrom

func NewOffsetFrom(expr string) ([]*Offset, error)

func (*Offset) Offset

func (o *Offset) Offset() int

func (*Offset) QueryMod

func (o *Offset) QueryMod() []qm.QueryMod

func (*Offset) ToString

func (o *Offset) ToString() string

type Operator

type Operator string
const (
	Equal              Operator = "eq"
	NotEqual           Operator = "ne"
	GreaterThan        Operator = "gt"
	GreaterThanOrEqual Operator = "ge"
	LessThan           Operator = "lt"
	LessThanOrEqual    Operator = "le"
	In                 Operator = "in"
	NotIn              Operator = "notIn"
	IsNull             Operator = "isNull"
	IsNotNull          Operator = "isNotNull"
	Contains           Operator = "contains"
	StartsWith         Operator = "startswith"
	EndsWith           Operator = "endswith"
)

type Or

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

func NewCombinerOR

func NewCombinerOR(l *Where, r *Where, e ...*Where) *Or

func (*Or) Or

func (o *Or) Or() []*Where

func (*Or) QueryMod

func (o *Or) QueryMod() []qm.QueryMod

func (*Or) ToString

func (o *Or) ToString() string

type OrderBy

type OrderBy struct {
	Table     string
	Column    string
	Direction Direction
}

func NewOrderBy

func NewOrderBy(column string, direction Direction) *OrderBy

func NewOrderByFrom

func NewOrderByFrom(expr string) ([]*OrderBy, error)

func NewOrderByWithTable

func NewOrderByWithTable(table, column string, direction Direction) *OrderBy

func (*OrderBy) OrderBy

func (o *OrderBy) OrderBy() string

func (*OrderBy) QueryMod

func (o *OrderBy) QueryMod() []qm.QueryMod

func (*OrderBy) ToString

func (o *OrderBy) ToString() string

type Relation

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

func NewRelation

func NewRelation(table string, tables ...string) *Relation

func (*Relation) QueryMod

func (r *Relation) QueryMod() []qm.QueryMod

func (*Relation) Relation

func (r *Relation) Relation() []string

func (*Relation) ToString

func (r *Relation) ToString() string

type Select

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

func NewSelect

func NewSelect(column string, columns ...string) *Select

func (*Select) QueryMod

func (s *Select) QueryMod() []qm.QueryMod

func (*Select) Select

func (s *Select) Select() []string

func (*Select) ToString

func (s *Select) ToString() string

type Where

type Where struct {
	Table    string
	Column   string
	Operator Operator
	Value    interface{}
}

func NewWhere

func NewWhere(column string, operator Operator, values ...interface{}) *Where

func NewWhereFrom

func NewWhereFrom(filter string) ([]*Where, error)

NewWhereFrom parses an Expression filter string into a slice of expression structs

func NewWhereWithTable

func NewWhereWithTable(table string, column string, operator Operator, values ...interface{}) *Where

func (*Where) QueryMod

func (w *Where) QueryMod() []qm.QueryMod

func (*Where) ToString

func (w *Where) ToString() string

func (*Where) Where

func (w *Where) Where() string

Jump to

Keyboard shortcuts

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