iters

package
v0.19.0 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetInt64Value

func GetInt64Value(ctx *sql.Context, expr sql.Expression) (int64, error)

GetInt64Value returns the int64 literal value in the expression given, or an error with the errStr given if it cannot.

func NewDistinctIter

func NewDistinctIter(ctx *sql.Context, child sql.RowIter) *distinctIter

func NewOrderedDistinctIter

func NewOrderedDistinctIter(child sql.RowIter, schema sql.Schema) *orderedDistinctIter

func NewSortIter

func NewSortIter(s sql.SortFields, child sql.RowIter) *sortIter

func NewTopRowsIter

func NewTopRowsIter(s sql.SortFields, limit int64, calcFoundRows bool, child sql.RowIter, childSchemaLen int) *topRowsIter

Types

type ExceptIter

type ExceptIter struct {
	LIter, RIter sql.RowIter
	// contains filtered or unexported fields
}

func (*ExceptIter) Close

func (ei *ExceptIter) Close(ctx *sql.Context) error

func (*ExceptIter) Next

func (ei *ExceptIter) Next(ctx *sql.Context) (sql.Row, error)

type IntersectIter

type IntersectIter struct {
	LIter, RIter sql.RowIter
	// contains filtered or unexported fields
}

func (*IntersectIter) Close

func (ii *IntersectIter) Close(ctx *sql.Context) error

func (*IntersectIter) Next

func (ii *IntersectIter) Next(ctx *sql.Context) (sql.Row, error)

type JsonTableCol

type JsonTableCol struct {
	Path string // if there are nested columns, this is a schema Path, otherwise it is a col Path
	Opts *JsonTableColOpts
	Cols []*JsonTableCol // nested columns
	// contains filtered or unexported fields
}

JsonTableCol represents a column in a json table.

func (*JsonTableCol) IsSibling

func (c *JsonTableCol) IsSibling() bool

IsSibling returns if the jsonTableCol contains multiple columns

func (*JsonTableCol) LoadData

func (c *JsonTableCol) LoadData(obj interface{})

LoadData loads the data for this column from the given object and c.path LoadData will always wrap the data in a slice to ensure it is iterable Additionally, this function will set the c.currSib to the first sibling

func (*JsonTableCol) Next

func (c *JsonTableCol) Next(obj interface{}, pass bool, ord int) (sql.Row, error)

Next returns the next row for this column.

func (*JsonTableCol) NextSibling

func (c *JsonTableCol) NextSibling() bool

NextSibling starts at the current sibling and moves to the next unfinished sibling if there are no more unfinished siblings, it sets c.currSib to the first sibling and returns true if the c.currSib is unfinished, nothing changes

func (*JsonTableCol) Reset

func (c *JsonTableCol) Reset()

Reset clears the column's data and error, and recursively resets all nested columns

type JsonTableColOpts

type JsonTableColOpts struct {
	Name      string
	Typ       sql.Type
	ForOrd    bool
	Exists    bool
	DefErrVal interface{}
	DefEmpVal interface{}
	ErrOnErr  bool
	ErrOnEmp  bool
}

type JsonTableRowIter

type JsonTableRowIter struct {
	Data []interface{}

	Cols []*JsonTableCol
	// contains filtered or unexported fields
}

func (*JsonTableRowIter) Close

func (j *JsonTableRowIter) Close(ctx *sql.Context) error

func (*JsonTableRowIter) Next

func (j *JsonTableRowIter) Next(ctx *sql.Context) (sql.Row, error)

func (*JsonTableRowIter) NextSibling

func (j *JsonTableRowIter) NextSibling() bool

NextSibling starts at the current sibling and moves to the next unfinished sibling if there are no more unfinished siblings, it resets to the first sibling

func (*JsonTableRowIter) ResetAll

func (j *JsonTableRowIter) ResetAll()

type LimitIter

type LimitIter struct {
	CalcFoundRows bool

	ChildIter sql.RowIter
	Limit     int64
	// contains filtered or unexported fields
}

func (*LimitIter) Close

func (li *LimitIter) Close(ctx *sql.Context) error

func (*LimitIter) Next

func (li *LimitIter) Next(ctx *sql.Context) (sql.Row, error)

type RecursiveTableIter

type RecursiveTableIter struct {
	Buf []sql.Row
	// contains filtered or unexported fields
}

TODO a queue is probably more optimal

func (*RecursiveTableIter) Close

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

func (*RecursiveTableIter) Next

func (r *RecursiveTableIter) Next(ctx *sql.Context) (sql.Row, error)

type UnionIter

type UnionIter struct {
	Cur      sql.RowIter
	NextIter func(ctx *sql.Context) (sql.RowIter, error)
}

func (*UnionIter) Close

func (ui *UnionIter) Close(ctx *sql.Context) error

func (*UnionIter) Next

func (ui *UnionIter) Next(ctx *sql.Context) (sql.Row, error)

Jump to

Keyboard shortcuts

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