Documentation ¶
Index ¶
- Variables
- type Aggregate
- type AggregateExpression
- type BaseIndex
- type Callable
- type CatalogSet
- type Cataloger
- type Constraint
- type ExecutionContext
- func (c ExecutionContext) AddOuterRow(row rows.Row) ExecutionContext
- func (c ExecutionContext) Catalog() CatalogSet
- func (c ExecutionContext) Log(format string, args ...interface{})
- func (c ExecutionContext) OptimizationContext() OptimizationContext
- func (c ExecutionContext) OuterRow() rows.Row
- func (c ExecutionContext) WithDebug() ExecutionContext
- type Expression
- type ExpressionResolutionContext
- type ExpressionWithDirection
- type Function
- type Index
- type NodeResolutionContext
- func (ctx *NodeResolutionContext) Bind(fields []fields.Field)
- func (ctx *NodeResolutionContext) Catalog() CatalogSet
- func (ctx *NodeResolutionContext) CurrentScope() *Scope
- func (ctx *NodeResolutionContext) ExpressionResolutionContext(allowAggregateFunctions bool) ExpressionResolutionContext
- func (ctx *NodeResolutionContext) Lookup(relationName, name string) (fields.Field, error)
- func (ctx *NodeResolutionContext) PopScope()
- func (ctx *NodeResolutionContext) PushScope()
- func (ctx *NodeResolutionContext) WithScope(f func() error) error
- type OptimizationContext
- type OrderExpression
- type ScanOptions
- type Scope
- type Sequence
- type Table
- type TableField
- func (f TableField) Default(ctx ExecutionContext) (any, error)
- func (f TableField) Nullable() bool
- func (f TableField) WithDefault(defaultExpression Expression) TableField
- func (f TableField) WithNonNullable() TableField
- func (f TableField) WithRelationName(relationName string) TableField
- func (f TableField) WithType(typ types.Type) TableField
Constants ¶
This section is empty.
Variables ¶
View Source
var EmptyExecutionContext = NewExecutionContext(NewCatalogEmptySet())
Functions ¶
This section is empty.
Types ¶
type Aggregate ¶
type Aggregate interface { Callable Step(ctx ExecutionContext, state any, args []any) (any, error) Done(ctx ExecutionContext, state any) (any, error) }
type AggregateExpression ¶
type AggregateExpression interface { Step(ctx ExecutionContext, row rows.Row) error Done(ctx ExecutionContext) (any, error) }
type Callable ¶
type CatalogSet ¶
type CatalogSet struct { Tables *catalog.Catalog[Table] Sequences *catalog.Catalog[Sequence] Functions *catalog.Catalog[Function] Aggregates *catalog.Catalog[Aggregate] }
func NewCatalogEmptySet ¶
func NewCatalogEmptySet() CatalogSet
type Cataloger ¶
type Cataloger interface {
Catalog() CatalogSet
}
type Constraint ¶
type Constraint interface { Name() string Check(ctx ExecutionContext, row rows.Row) error }
type ExecutionContext ¶
type ExecutionContext struct {
// contains filtered or unexported fields
}
func NewExecutionContext ¶
func NewExecutionContext(catalog CatalogSet) ExecutionContext
func (ExecutionContext) AddOuterRow ¶
func (c ExecutionContext) AddOuterRow(row rows.Row) ExecutionContext
func (ExecutionContext) Catalog ¶
func (c ExecutionContext) Catalog() CatalogSet
func (ExecutionContext) Log ¶
func (c ExecutionContext) Log(format string, args ...interface{})
func (ExecutionContext) OptimizationContext ¶
func (c ExecutionContext) OptimizationContext() OptimizationContext
func (ExecutionContext) OuterRow ¶
func (c ExecutionContext) OuterRow() rows.Row
func (ExecutionContext) WithDebug ¶
func (c ExecutionContext) WithDebug() ExecutionContext
type Expression ¶
type Expression interface { fmt.Stringer Resolve(ctx ExpressionResolutionContext) error Type() types.Type Equal(other Expression) bool Children() []Expression Fold() Expression Map(f func(Expression) (Expression, error)) (Expression, error) ValueFrom(cts ExecutionContext, row rows.Row) (any, error) }
type ExpressionResolutionContext ¶
type ExpressionResolutionContext struct {
// contains filtered or unexported fields
}
func NewExpressionResolutionContext ¶
func NewExpressionResolutionContext(catalog CatalogSet, allowAggregateFunctions bool) ExpressionResolutionContext
func (ExpressionResolutionContext) AllowAggregateFunctions ¶
func (ctx ExpressionResolutionContext) AllowAggregateFunctions() bool
func (ExpressionResolutionContext) Catalog ¶
func (ctx ExpressionResolutionContext) Catalog() CatalogSet
type ExpressionWithDirection ¶
type ExpressionWithDirection struct { Expression Expression Reverse bool }
func (ExpressionWithDirection) Fold ¶
func (e ExpressionWithDirection) Fold() ExpressionWithDirection
type Function ¶
type Function interface { Callable Invoke(ctx ExecutionContext, args []any) (any, error) }
type Index ¶
type Index[O ScanOptions] interface { BaseIndex Description(opts O) string Condition(opts O) Expression Ordering(opts O) OrderExpression Scanner(ctx ExecutionContext, opts O) (scan.TIDScanner, error) }
type NodeResolutionContext ¶
type NodeResolutionContext struct { Scopes []Scope // contains filtered or unexported fields }
func NewNodeResolutionContext ¶
func NewNodeResolutionContext(catalog CatalogSet) *NodeResolutionContext
func (*NodeResolutionContext) Bind ¶
func (ctx *NodeResolutionContext) Bind(fields []fields.Field)
func (*NodeResolutionContext) Catalog ¶
func (ctx *NodeResolutionContext) Catalog() CatalogSet
func (*NodeResolutionContext) CurrentScope ¶
func (ctx *NodeResolutionContext) CurrentScope() *Scope
func (*NodeResolutionContext) ExpressionResolutionContext ¶
func (ctx *NodeResolutionContext) ExpressionResolutionContext(allowAggregateFunctions bool) ExpressionResolutionContext
func (*NodeResolutionContext) Lookup ¶
func (ctx *NodeResolutionContext) Lookup(relationName, name string) (fields.Field, error)
func (*NodeResolutionContext) PopScope ¶
func (ctx *NodeResolutionContext) PopScope()
func (*NodeResolutionContext) PushScope ¶
func (ctx *NodeResolutionContext) PushScope()
func (*NodeResolutionContext) WithScope ¶
func (ctx *NodeResolutionContext) WithScope(f func() error) error
type OptimizationContext ¶
type OptimizationContext struct {
// contains filtered or unexported fields
}
func NewOptimizationContext ¶
func NewOptimizationContext(catalog CatalogSet) OptimizationContext
func (OptimizationContext) AddOuterFields ¶
func (c OptimizationContext) AddOuterFields(fields []fields.Field) OptimizationContext
func (OptimizationContext) Catalog ¶
func (c OptimizationContext) Catalog() CatalogSet
func (OptimizationContext) OuterFields ¶
func (c OptimizationContext) OuterFields() []fields.Field
type OrderExpression ¶
type OrderExpression interface { Expressions() []ExpressionWithDirection Fold() OrderExpression Map(f func(e Expression) (Expression, error)) (OrderExpression, error) }
type ScanOptions ¶
type ScanOptions any
type Table ¶
type Table interface { Name() string Indexes() []BaseIndex Fields() []TableField Size() int TIDs() []int64 Row(tid int64) (rows.Row, bool) SetPrimaryKey(index BaseIndex) error AddIndex(index BaseIndex) error AddConstraint(ctx ExecutionContext, constraint Constraint) error Insert(ctx ExecutionContext, row rows.Row) (_ rows.Row, err error) Delete(row rows.Row) (rows.Row, bool, error) }
type TableField ¶
func NewTableField ¶
func NewTableField(relationName, name string, typ types.Type, internalFieldType fields.InternalFieldType) TableField
func NewTableFieldFromField ¶
func NewTableFieldFromField(field fields.Field) TableField
func (TableField) Default ¶
func (f TableField) Default(ctx ExecutionContext) (any, error)
func (TableField) Nullable ¶
func (f TableField) Nullable() bool
func (TableField) WithDefault ¶
func (f TableField) WithDefault(defaultExpression Expression) TableField
func (TableField) WithNonNullable ¶
func (f TableField) WithNonNullable() TableField
TODO - make actual constraint?
func (TableField) WithRelationName ¶
func (f TableField) WithRelationName(relationName string) TableField
func (TableField) WithType ¶
func (f TableField) WithType(typ types.Type) TableField
Click to show internal directories.
Click to hide internal directories.