vtab

package module
v0.0.0-...-6572bfc Latest Latest
Warning

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

Go to latest
Published: Sep 15, 2021 License: MIT Imports: 7 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewTableFunc

func NewTableFunc(name string, columns []Column, newIterator GetIteratorFunc, opts ...OptFunc) sqlite.Module

Types

type Column

type Column struct {
	Name    string
	Type    string
	NotNull bool
	Hidden  bool
	Filters []*ColumnFilter
	OrderBy Orders
}

type ColumnFilter

type ColumnFilter struct {
	Op        sqlite.ConstraintOp
	OmitCheck bool
}

type Constraint

type Constraint struct {
	ColIndex int
	Op       sqlite.ConstraintOp
	Value    *sqlite.Value
}

type Context

type Context interface {
	ResultInt(v int)
	ResultInt64(v int64)
	ResultFloat(v float64)
	ResultNull()
	ResultValue(v sqlite.Value)
	ResultZeroBlob(n int64)
	ResultText(v string)
	ResultError(err error)
	ResultPointer(val interface{})
}

type GetIteratorFunc

type GetIteratorFunc func(constraints []*Constraint, order []*sqlite.OrderBy) (Iterator, error)

type Iterator

type Iterator interface {
	Next() (Row, error)
}

type OptFunc

type OptFunc func(*options)

func EarlyOrderByConstraintExit

func EarlyOrderByConstraintExit(value bool) OptFunc

EarlyOrderByConstraintExit tells the table-func to end iteration early, if results are ordered by a field that is also in a WHERE clause with one of a >,>=,<,<= that would warrant an early exit. This assumes that the column in question has the GT, GE, LT, LE constraints registered.

type Orders

type Orders uint8
const (
	NONE Orders = iota
	DESC
	ASC
)

type Row

type Row interface {
	Column(ctx Context, col int) error
}

Directories

Path Synopsis
_examples
pkg
sqlite
Package sqlite provides a golang target that depends on sqlite's C amalgamation file.
Package sqlite provides a golang target that depends on sqlite's C amalgamation file.

Jump to

Keyboard shortcuts

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