Documentation
¶
Index ¶
- Variables
- type Aggregation
- type AggregationExpression
- type Catalog
- type Column
- type Database
- type Databases
- type Expression
- type ExpressionBuilder
- type FunctionRegistry
- type Nameable
- type Node
- type Resolvable
- type Row
- type RowIter
- type Schema
- type Table
- type Transformable
- type Type
- type UnresolvedDatabase
- type Value
Constants ¶
This section is empty.
Variables ¶
var BigInteger = bigIntegerType{}
var ErrInvalidType = errors.New("invalid type")
var Integer = integerType{}
var Null = nullType{}
var String = stringType{}
var TimestampWithTimezone = timestampWithTimeZoneType{}
TimestampWithTimezone is a timestamp with timezone.
Functions ¶
This section is empty.
Types ¶
type Aggregation ¶ added in v0.3.0
type AggregationExpression ¶ added in v0.3.0
type AggregationExpression interface { Expression // NewBuffer creates a new aggregation buffer and returns it as a Row. NewBuffer() Row // Update updates the given buffer with the given row. Update(buffer, row Row) // Merge merges a partial buffer into a global one. Merge(buffer, partial Row) }
AggregationExpression implements an aggregation expression, where an aggregation buffer is created for each grouping (NewBuffer) and rows in the grouping are fed to the buffer (Update). Multiple buffers can be merged (Merge), making partial aggregations possible. Note that Eval must be called with the final aggregation buffer in order to get the final result.
type Catalog ¶
type Catalog struct { Databases FunctionRegistry }
Catalog holds databases, tables and functions.
func NewCatalog ¶ added in v0.3.0
func NewCatalog() *Catalog
NewCatalog returns a new empty Catalog.
type Databases ¶ added in v0.5.0
type Databases []Database
Databases is a collection of Database.
type Expression ¶
type Expression interface { Resolvable Type() Type Name() string Eval(Row) interface{} TransformUp(func(Expression) Expression) Expression }
type ExpressionBuilder ¶ added in v0.5.0
type ExpressionBuilder interface {
Build(...Expression) (Expression, error)
}
ExpressionBuilder can build an Expression out of a given list of expressions.
type FunctionRegistry ¶ added in v0.5.0
type FunctionRegistry map[string]ExpressionBuilder
FunctionRegistry is used to register functions. It is used both for builtin and User-Defined Functions.
func NewFunctionRegistry ¶ added in v0.5.0
func NewFunctionRegistry() FunctionRegistry
NewFunctionRegistry creates a new FunctionRegistry.
func (FunctionRegistry) Function ¶ added in v0.5.0
func (r FunctionRegistry) Function(name string) (ExpressionBuilder, error)
Function returns an ExpressionBuilder for the given function name.
func (FunctionRegistry) RegisterFunction ¶ added in v0.5.0
func (r FunctionRegistry) RegisterFunction(name string, f interface{}) error
RegisterFunction registers a function with the given name.
type Node ¶
type Node interface { Resolvable Transformable Schema() Schema Children() []Node RowIter() (RowIter, error) }
type Resolvable ¶
type Resolvable interface {
Resolved() bool
}
type Transformable ¶
type Transformable interface { TransformUp(func(Node) Node) Node TransformExpressionsUp(func(Expression) Expression) Node }
type Type ¶
type Type interface { Name() string InternalType() reflect.Kind Check(interface{}) bool Convert(interface{}) (interface{}, error) Compare(interface{}, interface{}) int Native(interface{}) driver.Value }
var Boolean Type = booleanType{}
var Float Type = floatType{}
type UnresolvedDatabase ¶ added in v0.1.0
type UnresolvedDatabase struct{}
func (*UnresolvedDatabase) Name ¶ added in v0.1.0
func (d *UnresolvedDatabase) Name() string
func (*UnresolvedDatabase) Tables ¶ added in v0.1.0
func (d *UnresolvedDatabase) Tables() map[string]Table