Documentation
¶
Index ¶
- Variables
- func Inspect(node sql.Node, f func(sql.Node) bool)
- func InspectExpressions(node sql.Node, f func(sql.Expression) bool)
- func Walk(v Visitor, node sql.Node)
- func WalkExpressions(v expression.Visitor, node sql.Node)
- type BinaryNode
- type CreateIndex
- func (c *CreateIndex) Children() []sql.Node
- func (c *CreateIndex) Expressions() []sql.Expression
- func (c *CreateIndex) Resolved() bool
- func (c *CreateIndex) RowIter(ctx *sql.Context) (sql.RowIter, error)
- func (c *CreateIndex) Schema() sql.Schema
- func (c *CreateIndex) String() string
- func (c *CreateIndex) TransformExpressions(fn sql.TransformExprFunc) (sql.Node, error)
- func (c *CreateIndex) TransformExpressionsUp(fn sql.TransformExprFunc) (sql.Node, error)
- func (c *CreateIndex) TransformUp(fn sql.TransformNodeFunc) (sql.Node, error)
- type CreateTable
- func (c *CreateTable) Children() []sql.Node
- func (c *CreateTable) Resolved() bool
- func (c *CreateTable) RowIter(s *sql.Context) (sql.RowIter, error)
- func (c *CreateTable) Schema() sql.Schema
- func (c *CreateTable) String() string
- func (c *CreateTable) TransformExpressionsUp(f sql.TransformExprFunc) (sql.Node, error)
- func (c *CreateTable) TransformUp(f sql.TransformNodeFunc) (sql.Node, error)
- type CrossJoin
- func (p *CrossJoin) Resolved() bool
- func (p *CrossJoin) RowIter(ctx *sql.Context) (sql.RowIter, error)
- func (p *CrossJoin) Schema() sql.Schema
- func (p *CrossJoin) String() string
- func (p *CrossJoin) TransformExpressionsUp(f sql.TransformExprFunc) (sql.Node, error)
- func (p *CrossJoin) TransformUp(f sql.TransformNodeFunc) (sql.Node, error)
- type Describe
- type DescribeQuery
- func (d *DescribeQuery) RowIter(ctx *sql.Context) (sql.RowIter, error)
- func (d *DescribeQuery) Schema() sql.Schema
- func (d *DescribeQuery) String() string
- func (d *DescribeQuery) TransformExpressionsUp(f sql.TransformExprFunc) (sql.Node, error)
- func (d *DescribeQuery) TransformUp(f sql.TransformNodeFunc) (sql.Node, error)
- type Distinct
- type DropIndex
- func (d *DropIndex) Children() []sql.Node
- func (d *DropIndex) Resolved() bool
- func (d *DropIndex) RowIter(ctx *sql.Context) (sql.RowIter, error)
- func (d *DropIndex) Schema() sql.Schema
- func (d *DropIndex) String() string
- func (d *DropIndex) TransformExpressionsUp(fn sql.TransformExprFunc) (sql.Node, error)
- func (d *DropIndex) TransformUp(fn sql.TransformNodeFunc) (sql.Node, error)
- type Filter
- func (p *Filter) Expressions() []sql.Expression
- func (p *Filter) Resolved() bool
- func (p *Filter) RowIter(ctx *sql.Context) (sql.RowIter, error)
- func (p *Filter) String() string
- func (p *Filter) TransformExpressions(f sql.TransformExprFunc) (sql.Node, error)
- func (p *Filter) TransformExpressionsUp(f sql.TransformExprFunc) (sql.Node, error)
- func (p *Filter) TransformUp(f sql.TransformNodeFunc) (sql.Node, error)
- type FilterIter
- type GroupBy
- func (p *GroupBy) Expressions() []sql.Expression
- func (p *GroupBy) Resolved() bool
- func (p *GroupBy) RowIter(ctx *sql.Context) (sql.RowIter, error)
- func (p *GroupBy) Schema() sql.Schema
- func (p *GroupBy) String() string
- func (p *GroupBy) TransformExpressions(f sql.TransformExprFunc) (sql.Node, error)
- func (p *GroupBy) TransformExpressionsUp(f sql.TransformExprFunc) (sql.Node, error)
- func (p *GroupBy) TransformUp(f sql.TransformNodeFunc) (sql.Node, error)
- type IndexableTable
- func (t IndexableTable) Children() []sql.Node
- func (t IndexableTable) Expressions() []sql.Expression
- func (t *IndexableTable) RowIter(ctx *sql.Context) (sql.RowIter, error)
- func (t IndexableTable) String() string
- func (t *IndexableTable) TransformExpressionsUp(f sql.TransformExprFunc) (sql.Node, error)
- func (t *IndexableTable) TransformUp(f sql.TransformNodeFunc) (sql.Node, error)
- type InnerJoin
- func (j *InnerJoin) Expressions() []sql.Expression
- func (j *InnerJoin) Resolved() bool
- func (j *InnerJoin) RowIter(ctx *sql.Context) (sql.RowIter, error)
- func (j *InnerJoin) Schema() sql.Schema
- func (j *InnerJoin) String() string
- func (j *InnerJoin) TransformExpressions(f sql.TransformExprFunc) (sql.Node, error)
- func (j *InnerJoin) TransformExpressionsUp(f sql.TransformExprFunc) (sql.Node, error)
- func (j *InnerJoin) TransformUp(f sql.TransformNodeFunc) (sql.Node, error)
- type InsertInto
- func (p *InsertInto) Execute(ctx *sql.Context) (int, error)
- func (p *InsertInto) RowIter(ctx *sql.Context) (sql.RowIter, error)
- func (p *InsertInto) Schema() sql.Schema
- func (p InsertInto) String() string
- func (p *InsertInto) TransformExpressionsUp(f sql.TransformExprFunc) (sql.Node, error)
- func (p *InsertInto) TransformUp(f sql.TransformNodeFunc) (sql.Node, error)
- type Limit
- type NaturalJoin
- func (NaturalJoin) Resolved() bool
- func (NaturalJoin) RowIter(*sql.Context) (sql.RowIter, error)
- func (NaturalJoin) Schema() sql.Schema
- func (j NaturalJoin) String() string
- func (j *NaturalJoin) TransformExpressionsUp(f sql.TransformExprFunc) (sql.Node, error)
- func (j *NaturalJoin) TransformUp(f sql.TransformNodeFunc) (sql.Node, error)
- type NullOrdering
- type Offset
- type OrderedDistinct
- func (d *OrderedDistinct) Resolved() bool
- func (d *OrderedDistinct) RowIter(ctx *sql.Context) (sql.RowIter, error)
- func (d OrderedDistinct) String() string
- func (d *OrderedDistinct) TransformExpressionsUp(f sql.TransformExprFunc) (sql.Node, error)
- func (d *OrderedDistinct) TransformUp(f sql.TransformNodeFunc) (sql.Node, error)
- type Project
- func (p *Project) Expressions() []sql.Expression
- func (p *Project) Resolved() bool
- func (p *Project) RowIter(ctx *sql.Context) (sql.RowIter, error)
- func (p *Project) Schema() sql.Schema
- func (p *Project) String() string
- func (p *Project) TransformExpressions(f sql.TransformExprFunc) (sql.Node, error)
- func (p *Project) TransformExpressionsUp(f sql.TransformExprFunc) (sql.Node, error)
- func (p *Project) TransformUp(f sql.TransformNodeFunc) (sql.Node, error)
- type PushdownProjectionAndFiltersTable
- func (t *PushdownProjectionAndFiltersTable) Expressions() []sql.Expression
- func (t *PushdownProjectionAndFiltersTable) RowIter(ctx *sql.Context) (sql.RowIter, error)
- func (t *PushdownProjectionAndFiltersTable) String() string
- func (t *PushdownProjectionAndFiltersTable) TransformExpressions(f sql.TransformExprFunc) (sql.Node, error)
- func (t *PushdownProjectionAndFiltersTable) TransformExpressionsUp(f sql.TransformExprFunc) (sql.Node, error)
- func (t *PushdownProjectionAndFiltersTable) TransformUp(f sql.TransformNodeFunc) (sql.Node, error)
- type PushdownProjectionTable
- func (t *PushdownProjectionTable) RowIter(ctx *sql.Context) (sql.RowIter, error)
- func (t PushdownProjectionTable) String() string
- func (t *PushdownProjectionTable) TransformExpressionsUp(f sql.TransformExprFunc) (sql.Node, error)
- func (t *PushdownProjectionTable) TransformUp(f sql.TransformNodeFunc) (sql.Node, error)
- type ShowTables
- func (*ShowTables) Children() []sql.Node
- func (p *ShowTables) Resolved() bool
- func (p *ShowTables) RowIter(ctx *sql.Context) (sql.RowIter, error)
- func (*ShowTables) Schema() sql.Schema
- func (p ShowTables) String() string
- func (p *ShowTables) TransformExpressionsUp(f sql.TransformExprFunc) (sql.Node, error)
- func (p *ShowTables) TransformUp(f sql.TransformNodeFunc) (sql.Node, error)
- type Sort
- func (s *Sort) Expressions() []sql.Expression
- func (s *Sort) Resolved() bool
- func (s *Sort) RowIter(ctx *sql.Context) (sql.RowIter, error)
- func (s *Sort) String() string
- func (s *Sort) TransformExpressions(f sql.TransformExprFunc) (sql.Node, error)
- func (s *Sort) TransformExpressionsUp(f sql.TransformExprFunc) (sql.Node, error)
- func (s *Sort) TransformUp(f sql.TransformNodeFunc) (sql.Node, error)
- type SortField
- type SortOrder
- type SubqueryAlias
- func (n *SubqueryAlias) Name() string
- func (n *SubqueryAlias) RowIter(ctx *sql.Context) (sql.RowIter, error)
- func (n *SubqueryAlias) Schema() sql.Schema
- func (n SubqueryAlias) String() string
- func (n *SubqueryAlias) TransformExpressionsUp(f sql.TransformExprFunc) (sql.Node, error)
- func (n *SubqueryAlias) TransformUp(f sql.TransformNodeFunc) (sql.Node, error)
- type TableAlias
- func (t *TableAlias) Name() string
- func (t *TableAlias) RowIter(ctx *sql.Context) (sql.RowIter, error)
- func (t TableAlias) String() string
- func (t *TableAlias) TransformExpressionsUp(f sql.TransformExprFunc) (sql.Node, error)
- func (t *TableAlias) TransformUp(f sql.TransformNodeFunc) (sql.Node, error)
- type UnaryNode
- type UnresolvedTable
- func (*UnresolvedTable) Children() []sql.Node
- func (*UnresolvedTable) Resolved() bool
- func (*UnresolvedTable) RowIter(ctx *sql.Context) (sql.RowIter, error)
- func (*UnresolvedTable) Schema() sql.Schema
- func (t UnresolvedTable) String() string
- func (t *UnresolvedTable) TransformExpressionsUp(f sql.TransformExprFunc) (sql.Node, error)
- func (t *UnresolvedTable) TransformUp(f sql.TransformNodeFunc) (sql.Node, error)
- type Values
- func (p *Values) Children() []sql.Node
- func (p *Values) Expressions() []sql.Expression
- func (p *Values) Resolved() bool
- func (p *Values) RowIter(ctx *sql.Context) (sql.RowIter, error)
- func (p *Values) Schema() sql.Schema
- func (p *Values) String() string
- func (p *Values) TransformExpressions(f sql.TransformExprFunc) (sql.Node, error)
- func (p *Values) TransformExpressionsUp(f sql.TransformExprFunc) (sql.Node, error)
- func (p *Values) TransformUp(f sql.TransformNodeFunc) (sql.Node, error)
- type Visitor
Constants ¶
This section is empty.
Variables ¶
var ( // ErrNotIndexable is returned when the table is not indexable. ErrNotIndexable = errors.NewKind("the table is not indexable") // ErrInvalidIndexDriver is returned when the index driver can't be found. ErrInvalidIndexDriver = errors.NewKind("invalid driver index %q") // ErrTableNotNameable is returned when the table name can't be obtained. ErrTableNotNameable = errors.NewKind("can't get the name from the table") )
var DescribeSchema = sql.Schema{ {Name: "plan", Type: sql.Text}, }
DescribeSchema is the schema returned by a DescribeQuery node.
var ErrCreateTable = errors.NewKind("tables cannot be created on database %s")
ErrCreateTable is thrown when the database doesn't support table creation
var ErrGroupBy = errors.NewKind("group by aggregation '%v' not supported")
ErrGroupBy is returned when the aggregation is not supported.
var ErrIndexNotFound = errors.NewKind("unable to find index %q on table %q of database %q")
ErrIndexNotFound is returned when the index cannot be found.
var ErrInsertIntoNotSupported = errors.NewKind("table doesn't support INSERT INTO")
ErrInsertIntoNotSupported is thrown when a table doesn't support inserts
var ErrUnableSort = errors.NewKind("unable to sort")
ErrUnableSort is thrown when something happens on sorting
var ErrUnresolvedTable = errors.NewKind("unresolved table")
ErrUnresolvedTable is thrown when a table cannot be resolved
Functions ¶
func Inspect ¶
Inspect traverses the plan in depth-first order: It starts by calling f(node); node must not be nil. If f returns true, Inspect invokes f recursively for each of the children of node, followed by a call of f(nil).
func InspectExpressions ¶
func InspectExpressions(node sql.Node, f func(sql.Expression) bool)
InspectExpressions traverses the plan and calls expression.Inspect on any expression it finds.
func Walk ¶
Walk traverses the plan tree in depth-first order. It starts by calling v.Visit(node); node must not be nil. If the visitor returned by v.Visit(node) is not nil, Walk is invoked recursively with the returned visitor for each children of the node, followed by a call of v.Visit(nil) to the returned visitor.
func WalkExpressions ¶
func WalkExpressions(v expression.Visitor, node sql.Node)
WalkExpressions traverses the plan and calls expression.Walk on any expression it finds.
Types ¶
type BinaryNode ¶
BinaryNode is a node with two children.
func (BinaryNode) Children ¶
func (n BinaryNode) Children() []sql.Node
Children implements the Node interface.
func (BinaryNode) Resolved ¶
func (n BinaryNode) Resolved() bool
Resolved implements the Resolvable interface.
type CreateIndex ¶
type CreateIndex struct { Name string Table sql.Node Exprs []sql.Expression Driver string Config map[string]string Catalog *sql.Catalog CurrentDatabase string }
CreateIndex is a node to create an index.
func NewCreateIndex ¶
func NewCreateIndex( name string, table sql.Node, exprs []sql.Expression, driver string, config map[string]string, ) *CreateIndex
NewCreateIndex creates a new CreateIndex node.
func (*CreateIndex) Children ¶
func (c *CreateIndex) Children() []sql.Node
Children implements the Node interface.
func (*CreateIndex) Expressions ¶
func (c *CreateIndex) Expressions() []sql.Expression
Expressions implements the Expressioner interface.
func (*CreateIndex) Resolved ¶
func (c *CreateIndex) Resolved() bool
Resolved implements the Node interface.
func (*CreateIndex) Schema ¶
func (c *CreateIndex) Schema() sql.Schema
Schema implements the Node interface.
func (*CreateIndex) String ¶
func (c *CreateIndex) String() string
func (*CreateIndex) TransformExpressions ¶
func (c *CreateIndex) TransformExpressions(fn sql.TransformExprFunc) (sql.Node, error)
TransformExpressions implements the Expressioner interface.
func (*CreateIndex) TransformExpressionsUp ¶
func (c *CreateIndex) TransformExpressionsUp(fn sql.TransformExprFunc) (sql.Node, error)
TransformExpressionsUp implements the Node interface.
func (*CreateIndex) TransformUp ¶
func (c *CreateIndex) TransformUp(fn sql.TransformNodeFunc) (sql.Node, error)
TransformUp implements the Node interface.
type CreateTable ¶
CreateTable is a node describing the creation of some table.
func NewCreateTable ¶
NewCreateTable creates a new CreateTable node
func (*CreateTable) Children ¶
func (c *CreateTable) Children() []sql.Node
Children implements the Node interface.
func (*CreateTable) Resolved ¶
func (c *CreateTable) Resolved() bool
Resolved implements the Resolvable interface.
func (*CreateTable) Schema ¶
func (c *CreateTable) Schema() sql.Schema
Schema implements the Node interface.
func (*CreateTable) String ¶
func (c *CreateTable) String() string
func (*CreateTable) TransformExpressionsUp ¶
func (c *CreateTable) TransformExpressionsUp(f sql.TransformExprFunc) (sql.Node, error)
TransformExpressionsUp implements the Transformable interface.
func (*CreateTable) TransformUp ¶
func (c *CreateTable) TransformUp(f sql.TransformNodeFunc) (sql.Node, error)
TransformUp implements the Transformable interface.
type CrossJoin ¶
type CrossJoin struct {
BinaryNode
}
CrossJoin is a cross join between two tables.
func NewCrossJoin ¶
NewCrossJoin creates a new cross join node from two tables.
func (*CrossJoin) TransformExpressionsUp ¶
TransformExpressionsUp implements the Transformable interface.
func (*CrossJoin) TransformUp ¶
TransformUp implements the Transformable interface.
type Describe ¶
type Describe struct {
UnaryNode
}
Describe is a node that describes its children.
func NewDescribe ¶
NewDescribe creates a new Describe node.
func (*Describe) TransformExpressionsUp ¶
TransformExpressionsUp implements the Transformable interface.
func (*Describe) TransformUp ¶
TransformUp implements the Transformable interface.
type DescribeQuery ¶
DescribeQuery returns the description of the query plan.
func NewDescribeQuery ¶
func NewDescribeQuery(format string, child sql.Node) *DescribeQuery
NewDescribeQuery creates a new DescribeQuery node.
func (*DescribeQuery) Schema ¶
func (d *DescribeQuery) Schema() sql.Schema
Schema implements the Node interface.
func (*DescribeQuery) String ¶
func (d *DescribeQuery) String() string
func (*DescribeQuery) TransformExpressionsUp ¶
func (d *DescribeQuery) TransformExpressionsUp(f sql.TransformExprFunc) (sql.Node, error)
TransformExpressionsUp implements the Node interface.
func (*DescribeQuery) TransformUp ¶
func (d *DescribeQuery) TransformUp(f sql.TransformNodeFunc) (sql.Node, error)
TransformUp implements the Node interface.
type Distinct ¶
type Distinct struct {
UnaryNode
}
Distinct is a node that ensures all rows that come from it are unique.
func NewDistinct ¶
NewDistinct creates a new Distinct node.
func (*Distinct) TransformExpressionsUp ¶
TransformExpressionsUp implements the Transformable interface.
func (*Distinct) TransformUp ¶
TransformUp implements the Transformable interface.
type DropIndex ¶
DropIndex is a node to drop an index.
func NewDropIndex ¶
NewDropIndex creates a new DropIndex node.
func (*DropIndex) TransformExpressionsUp ¶
TransformExpressionsUp implements the Node interface.
func (*DropIndex) TransformUp ¶
TransformUp implements the Node interface.
type Filter ¶
type Filter struct { UnaryNode Expression sql.Expression }
Filter skips rows that don't match a certain expression.
func NewFilter ¶
func NewFilter(expression sql.Expression, child sql.Node) *Filter
NewFilter creates a new filter node.
func (*Filter) Expressions ¶
func (p *Filter) Expressions() []sql.Expression
Expressions implements the Expressioner interface.
func (*Filter) TransformExpressions ¶
TransformExpressions implements the Expressioner interface.
func (*Filter) TransformExpressionsUp ¶
TransformExpressionsUp implements the Transformable interface.
func (*Filter) TransformUp ¶
TransformUp implements the Transformable interface.
type FilterIter ¶
type FilterIter struct {
// contains filtered or unexported fields
}
FilterIter is an iterator that filters another iterator and skips rows that don't match the given condition.
func NewFilterIter ¶
func NewFilterIter( ctx *sql.Context, cond sql.Expression, child sql.RowIter, ) *FilterIter
NewFilterIter creates a new FilterIter.
func (*FilterIter) Close ¶
func (i *FilterIter) Close() error
Close implements the RowIter interface.
type GroupBy ¶
type GroupBy struct { UnaryNode Aggregate []sql.Expression Grouping []sql.Expression }
GroupBy groups the rows by some expressions.
func NewGroupBy ¶
func NewGroupBy( aggregate []sql.Expression, grouping []sql.Expression, child sql.Node, ) *GroupBy
NewGroupBy creates a new GroupBy node.
func (*GroupBy) Expressions ¶
func (p *GroupBy) Expressions() []sql.Expression
Expressions implements the Expressioner interface.
func (*GroupBy) TransformExpressions ¶
TransformExpressions implements the Expressioner interface.
func (*GroupBy) TransformExpressionsUp ¶
TransformExpressionsUp implements the Transformable interface.
func (*GroupBy) TransformUp ¶
TransformUp implements the Transformable interface.
type IndexableTable ¶
type IndexableTable struct { sql.Indexable Columns []sql.Expression Filters []sql.Expression Index sql.IndexLookup }
IndexableTable is a node wrapping a table implementing the sql.Inedxable interface so it returns a RowIter with custom logic given the set of used columns that need to be projected, the filtes that apply to that table and the indexes to use. IndexableTable nodes don't propagate transformations to the underlying table.
func NewIndexableTable ¶
func NewIndexableTable( columns []sql.Expression, filters []sql.Expression, index sql.IndexLookup, table sql.Indexable, ) *IndexableTable
NewPushdownProjectionAndFiltersTable creates a new PushdownProjectionAndFiltersTable node.
func (IndexableTable) Children ¶
func (t IndexableTable) Children() []sql.Node
Children implements the Node interface.
func (IndexableTable) Expressions ¶
func (t IndexableTable) Expressions() []sql.Expression
Expressions implements the Expressioner interface.
func (IndexableTable) String ¶
func (t IndexableTable) String() string
func (*IndexableTable) TransformExpressionsUp ¶
func (t *IndexableTable) TransformExpressionsUp( f sql.TransformExprFunc, ) (sql.Node, error)
TransformExpressionsUp implements the Node interface.
func (*IndexableTable) TransformUp ¶
func (t *IndexableTable) TransformUp( f sql.TransformNodeFunc, ) (sql.Node, error)
TransformUp implements the Node interface.
type InnerJoin ¶
type InnerJoin struct { BinaryNode Cond sql.Expression }
InnerJoin is an inner join between two tables.
func NewInnerJoin ¶
func NewInnerJoin(left, right sql.Node, cond sql.Expression) *InnerJoin
NewInnerJoin creates a new inner join node from two tables.
func (*InnerJoin) Expressions ¶
func (j *InnerJoin) Expressions() []sql.Expression
Expressions implements the Expressioner interface.
func (*InnerJoin) TransformExpressions ¶
TransformExpressions implements the Expressioner interface.
func (*InnerJoin) TransformExpressionsUp ¶
TransformExpressionsUp implements the Transformable interface.
func (*InnerJoin) TransformUp ¶
TransformUp implements the Transformable interface.
type InsertInto ¶
type InsertInto struct { BinaryNode Columns []string }
InsertInto is a node describing the insertion into some table.
func NewInsertInto ¶
func NewInsertInto(dst, src sql.Node, cols []string) *InsertInto
NewInsertInto creates an InsertInto node.
func (*InsertInto) Execute ¶
func (p *InsertInto) Execute(ctx *sql.Context) (int, error)
Execute inserts the rows in the database.
func (*InsertInto) Schema ¶
func (p *InsertInto) Schema() sql.Schema
Schema implements the Node interface.
func (InsertInto) String ¶
func (p InsertInto) String() string
func (*InsertInto) TransformExpressionsUp ¶
func (p *InsertInto) TransformExpressionsUp(f sql.TransformExprFunc) (sql.Node, error)
TransformExpressionsUp implements the Transformable interface.
func (*InsertInto) TransformUp ¶
func (p *InsertInto) TransformUp(f sql.TransformNodeFunc) (sql.Node, error)
TransformUp implements the Transformable interface.
type Limit ¶
type Limit struct { UnaryNode // contains filtered or unexported fields }
Limit is a node that only allows up to N rows to be retrieved.
func (*Limit) TransformExpressionsUp ¶
TransformExpressionsUp implements the Transformable interface.
func (*Limit) TransformUp ¶
TransformUp implements the Transformable interface.
type NaturalJoin ¶
type NaturalJoin struct {
BinaryNode
}
NaturalJoin is a join that automatically joins by all the columns with the same name. NaturalJoin is a placeholder node, it should be transformed into an INNER JOIN during analysis.
func NewNaturalJoin ¶
func NewNaturalJoin(left, right sql.Node) *NaturalJoin
NewNaturalJoin returns a new NaturalJoin node.
func (NaturalJoin) Resolved ¶
func (NaturalJoin) Resolved() bool
Resolved implements the Node interface.
func (NaturalJoin) Schema ¶
func (NaturalJoin) Schema() sql.Schema
Schema implements the Node interface.
func (NaturalJoin) String ¶
func (j NaturalJoin) String() string
func (*NaturalJoin) TransformExpressionsUp ¶
func (j *NaturalJoin) TransformExpressionsUp(f sql.TransformExprFunc) (sql.Node, error)
TransformExpressionsUp implements the Node interface.
func (*NaturalJoin) TransformUp ¶
func (j *NaturalJoin) TransformUp(f sql.TransformNodeFunc) (sql.Node, error)
TransformUp implements the Node interface.
type NullOrdering ¶
type NullOrdering byte
NullOrdering represents how to order based on null values.
const ( // NullsFirst puts the null values before any other values. NullsFirst NullOrdering = iota // NullsLast puts the null values after all other values. NullsLast NullOrdering = 2 )
type Offset ¶
type Offset struct { UnaryNode // contains filtered or unexported fields }
Offset is a node that skips the first N rows.
func (*Offset) TransformExpressionsUp ¶
TransformExpressionsUp implements the Transformable interface.
func (*Offset) TransformUp ¶
TransformUp implements the Transformable interface.
type OrderedDistinct ¶
type OrderedDistinct struct {
UnaryNode
}
OrderedDistinct is a Distinct node optimized for sorted row sets. It's 2 orders of magnitude faster and uses 2 orders of magnitude less mem.
func NewOrderedDistinct ¶
func NewOrderedDistinct(child sql.Node) *OrderedDistinct
NewOrderedDistinct creates a new OrderedDistinct node.
func (*OrderedDistinct) Resolved ¶
func (d *OrderedDistinct) Resolved() bool
Resolved implements the Resolvable interface.
func (OrderedDistinct) String ¶
func (d OrderedDistinct) String() string
func (*OrderedDistinct) TransformExpressionsUp ¶
func (d *OrderedDistinct) TransformExpressionsUp(f sql.TransformExprFunc) (sql.Node, error)
TransformExpressionsUp implements the Transformable interface.
func (*OrderedDistinct) TransformUp ¶
func (d *OrderedDistinct) TransformUp(f sql.TransformNodeFunc) (sql.Node, error)
TransformUp implements the Transformable interface.
type Project ¶
type Project struct { UnaryNode // Expression projected. Projections []sql.Expression }
Project is a projection of certain expression from the children node.
func NewProject ¶
func NewProject(expressions []sql.Expression, child sql.Node) *Project
NewProject creates a new projection.
func (*Project) Expressions ¶
func (p *Project) Expressions() []sql.Expression
Expressions implements the Expressioner interface.
func (*Project) TransformExpressions ¶
TransformExpressions implements the Expressioner interface.
func (*Project) TransformExpressionsUp ¶
TransformExpressionsUp implements the Transformable interface.
func (*Project) TransformUp ¶
TransformUp implements the Transformable interface.
type PushdownProjectionAndFiltersTable ¶
type PushdownProjectionAndFiltersTable struct { sql.PushdownProjectionAndFiltersTable Columns []sql.Expression Filters []sql.Expression }
PushdownProjectionAndFiltersTable is a node wrapping a table implementing the sql.PushdownProjectionAndFiltersTable interface so it returns a RowIter with custom logic given the set of used columns that need to be projected and the filters that apply to that table. PushdownProjectionAndFiltersTable nodes don't propagate transformations.
func NewPushdownProjectionAndFiltersTable ¶
func NewPushdownProjectionAndFiltersTable( columns []sql.Expression, filters []sql.Expression, table sql.PushdownProjectionAndFiltersTable, ) *PushdownProjectionAndFiltersTable
NewPushdownProjectionAndFiltersTable creates a new PushdownProjectionAndFiltersTable node.
func (*PushdownProjectionAndFiltersTable) Expressions ¶
func (t *PushdownProjectionAndFiltersTable) Expressions() []sql.Expression
Expressions implements the Expressioner interface.
func (*PushdownProjectionAndFiltersTable) String ¶
func (t *PushdownProjectionAndFiltersTable) String() string
func (*PushdownProjectionAndFiltersTable) TransformExpressions ¶
func (t *PushdownProjectionAndFiltersTable) TransformExpressions(f sql.TransformExprFunc) (sql.Node, error)
TransformExpressions implements the Expressioner interface.
func (*PushdownProjectionAndFiltersTable) TransformExpressionsUp ¶
func (t *PushdownProjectionAndFiltersTable) TransformExpressionsUp( f sql.TransformExprFunc, ) (sql.Node, error)
TransformExpressionsUp implements the Node interface.
func (*PushdownProjectionAndFiltersTable) TransformUp ¶
func (t *PushdownProjectionAndFiltersTable) TransformUp( f sql.TransformNodeFunc, ) (sql.Node, error)
TransformUp implements the Node interface.
type PushdownProjectionTable ¶
type PushdownProjectionTable struct { sql.PushdownProjectionTable Columns []string }
PushdownProjectionTable is a node wrapping a table implementing the sql.PushdownProjectionTable interface so it returns a RowIter with custom logic given the set of used columns that need to be projected. PushdownProjectionTable nodes don't propagate transformations.
func NewPushdownProjectionTable ¶
func NewPushdownProjectionTable( columns []string, table sql.PushdownProjectionTable, ) *PushdownProjectionTable
NewPushdownProjectionTable creates a new PushdownProjectionTable node.
func (PushdownProjectionTable) String ¶
func (t PushdownProjectionTable) String() string
func (*PushdownProjectionTable) TransformExpressionsUp ¶
func (t *PushdownProjectionTable) TransformExpressionsUp( f sql.TransformExprFunc, ) (sql.Node, error)
TransformExpressionsUp implements the Node interface.
func (*PushdownProjectionTable) TransformUp ¶
func (t *PushdownProjectionTable) TransformUp(f sql.TransformNodeFunc) (sql.Node, error)
TransformUp implements the Node interface.
type ShowTables ¶
ShowTables is a node that shows the database tables.
func NewShowTables ¶
func NewShowTables(database sql.Database) *ShowTables
NewShowTables creates a new show tables node given a database.
func (*ShowTables) Children ¶
func (*ShowTables) Children() []sql.Node
Children implements the Node interface.
func (*ShowTables) Resolved ¶
func (p *ShowTables) Resolved() bool
Resolved implements the Resolvable interface.
func (*ShowTables) Schema ¶
func (*ShowTables) Schema() sql.Schema
Schema implements the Node interface.
func (ShowTables) String ¶
func (p ShowTables) String() string
func (*ShowTables) TransformExpressionsUp ¶
func (p *ShowTables) TransformExpressionsUp(f sql.TransformExprFunc) (sql.Node, error)
TransformExpressionsUp implements the Transformable interface.
func (*ShowTables) TransformUp ¶
func (p *ShowTables) TransformUp(f sql.TransformNodeFunc) (sql.Node, error)
TransformUp implements the Transformable interface.
type Sort ¶
Sort is the sort node.
func (*Sort) Expressions ¶
func (s *Sort) Expressions() []sql.Expression
Expressions implements the Expressioner interface.
func (*Sort) TransformExpressions ¶
TransformExpressions implements the Expressioner interface.
func (*Sort) TransformExpressionsUp ¶
TransformExpressionsUp implements the Transformable interface.
func (*Sort) TransformUp ¶
TransformUp implements the Transformable interface.
type SortField ¶
type SortField struct { // Column to order by. Column sql.Expression // Order type. Order SortOrder // NullOrdering defining how nulls will be ordered. NullOrdering NullOrdering }
SortField is a field by which the query will be sorted.
type SortOrder ¶
type SortOrder byte
SortOrder represents the order of the sort (ascending or descending).
type SubqueryAlias ¶
type SubqueryAlias struct { UnaryNode // contains filtered or unexported fields }
SubqueryAlias is a node that gives a subquery a name.
func NewSubqueryAlias ¶
func NewSubqueryAlias(name string, node sql.Node) *SubqueryAlias
NewSubqueryAlias creates a new SubqueryAlias node.
func (*SubqueryAlias) Name ¶
func (n *SubqueryAlias) Name() string
Name implements the Table interface.
func (*SubqueryAlias) Schema ¶
func (n *SubqueryAlias) Schema() sql.Schema
Schema implements the Node interface.
func (SubqueryAlias) String ¶
func (n SubqueryAlias) String() string
func (*SubqueryAlias) TransformExpressionsUp ¶
func (n *SubqueryAlias) TransformExpressionsUp(f sql.TransformExprFunc) (sql.Node, error)
TransformExpressionsUp implements the Node interface.
func (*SubqueryAlias) TransformUp ¶
func (n *SubqueryAlias) TransformUp(f sql.TransformNodeFunc) (sql.Node, error)
TransformUp implements the Node interface.
type TableAlias ¶
type TableAlias struct { *UnaryNode // contains filtered or unexported fields }
TableAlias is a node that acts as a table with a given name.
func NewTableAlias ¶
func NewTableAlias(name string, node sql.Node) *TableAlias
NewTableAlias returns a new Table alias node.
func (*TableAlias) Name ¶
func (t *TableAlias) Name() string
Name implements the Nameable interface.
func (TableAlias) String ¶
func (t TableAlias) String() string
func (*TableAlias) TransformExpressionsUp ¶
func (t *TableAlias) TransformExpressionsUp(f sql.TransformExprFunc) (sql.Node, error)
TransformExpressionsUp implements the Transformable interface.
func (*TableAlias) TransformUp ¶
func (t *TableAlias) TransformUp(f sql.TransformNodeFunc) (sql.Node, error)
TransformUp implements the Transformable interface.
type UnaryNode ¶
UnaryNode is a node that has only one children.
type UnresolvedTable ¶
type UnresolvedTable struct { // Name of the table. Name string }
UnresolvedTable is a table that has not been resolved yet but whose name is known.
func NewUnresolvedTable ¶
func NewUnresolvedTable(name string) *UnresolvedTable
NewUnresolvedTable creates a new Unresolved table.
func (*UnresolvedTable) Children ¶
func (*UnresolvedTable) Children() []sql.Node
Children implements the Node interface.
func (*UnresolvedTable) Resolved ¶
func (*UnresolvedTable) Resolved() bool
Resolved implements the Resolvable interface.
func (*UnresolvedTable) Schema ¶
func (*UnresolvedTable) Schema() sql.Schema
Schema implements the Node interface.
func (UnresolvedTable) String ¶
func (t UnresolvedTable) String() string
func (*UnresolvedTable) TransformExpressionsUp ¶
func (t *UnresolvedTable) TransformExpressionsUp(f sql.TransformExprFunc) (sql.Node, error)
TransformExpressionsUp implements the Transformable interface.
func (*UnresolvedTable) TransformUp ¶
func (t *UnresolvedTable) TransformUp(f sql.TransformNodeFunc) (sql.Node, error)
TransformUp implements the Transformable interface.
type Values ¶
type Values struct {
ExpressionTuples [][]sql.Expression
}
Values represents a set of tuples of expressions.
func NewValues ¶
func NewValues(tuples [][]sql.Expression) *Values
NewValues creates a Values node with the given tuples.
func (*Values) Expressions ¶
func (p *Values) Expressions() []sql.Expression
Expressions implements the Expressioner interface.
func (*Values) TransformExpressions ¶
TransformExpressions implements the Expressioner interface.
func (*Values) TransformExpressionsUp ¶
TransformExpressionsUp implements the Transformable interface.
func (*Values) TransformUp ¶
TransformUp implements the Transformable interface.
type Visitor ¶
type Visitor interface { // Visit method is invoked for each node encountered by Walk. // If the result Visitor is not nul, Walk visits each of the children // of the node with that visitor, followed by a call of Visit(nil) // to the returned visitor. Visit(node sql.Node) Visitor }
Visitor visits nodes in the plan.