Documentation
¶
Index ¶
- Constants
- Variables
- func ApplyBindings(n sql.Node, bindings map[string]sql.Expression) (sql.Node, error)
- func GetColumnFromIndexExpr(expr string, table sql.Table) *sql.Column
- func GetColumnsAndPrepareExpressions(exprs []sql.Expression) ([]string, []sql.Expression, error)
- func GetInsertable(node sql.Node) (sql.InsertableTable, error)
- func GetTruncatable(node sql.Node) (sql.TruncateableTable, error)
- func Inspect(node sql.Node, f func(sql.Node) bool)
- func InspectExpressions(node sql.Node, f func(sql.Expression) bool)
- func InspectExpressionsWithNode(node sql.Node, f func(sql.Node, sql.Expression) bool)
- func IsBinary(node sql.Node) bool
- func IsUnary(node sql.Node) bool
- func NewNotInSubquery(left sql.Expression, right sql.Expression) sql.Expression
- func NewShowCreateTable(table sql.Node, isView bool) sql.Node
- func NewShowIndexes(table sql.Node) sql.Node
- func NillaryWithChildren(node sql.Node, children ...sql.Node) (sql.Node, error)
- func ProjectRow(s *sql.Context, projections []sql.Expression, row sql.Row) (sql.Row, error)
- func TransformExpressions(node sql.Node, f sql.TransformExprFunc) (sql.Node, error)
- func TransformExpressionsUp(node sql.Node, f sql.TransformExprFunc) (sql.Node, error)
- func TransformExpressionsUpWithNode(node sql.Node, f expression.TransformExprWithNodeFunc) (sql.Node, error)
- func TransformExpressionsWithNode(n sql.Node, f expression.TransformExprWithNodeFunc) (sql.Node, error)
- func TransformUp(node sql.Node, f sql.TransformNodeFunc) (sql.Node, error)
- func TransformUpWithParent(node sql.Node, f TransformNodeWithParentFunc) (sql.Node, error)
- func TransformUpWithSelector(node sql.Node, selector ChildSelector, f sql.TransformNodeFunc) (sql.Node, error)
- func Walk(v Visitor, node sql.Node)
- func WalkExpressions(v sql.Visitor, node sql.Node)
- func WalkExpressionsWithNode(v sql.NodeVisitor, n sql.Node)
- type AddColumn
- func (c *AddColumn) Children() []sql.Node
- func (a *AddColumn) Column() *sql.Column
- func (c *AddColumn) Database() sql.Database
- func (a *AddColumn) Expressions() []sql.Expression
- func (a *AddColumn) Order() *sql.ColumnOrder
- func (a *AddColumn) Resolved() bool
- func (a *AddColumn) RowIter(ctx *sql.Context, row sql.Row) (sql.RowIter, error)
- func (a *AddColumn) Schema() sql.Schema
- func (a *AddColumn) String() string
- func (a *AddColumn) TableName() string
- func (a *AddColumn) WithChildren(children ...sql.Node) (sql.Node, error)
- func (a *AddColumn) WithDatabase(db sql.Database) (sql.Node, error)
- func (a *AddColumn) WithExpressions(exprs ...sql.Expression) (sql.Node, error)
- type AlterAutoIncrement
- func (p *AlterAutoIncrement) Execute(ctx *sql.Context) error
- func (p *AlterAutoIncrement) RowIter(ctx *sql.Context, _ sql.Row) (sql.RowIter, error)
- func (p *AlterAutoIncrement) Schema() sql.Schema
- func (p AlterAutoIncrement) String() string
- func (p *AlterAutoIncrement) WithChildren(children ...sql.Node) (sql.Node, error)
- type AlterIndex
- func (p *AlterIndex) Children() []sql.Node
- func (p *AlterIndex) Execute(ctx *sql.Context) error
- func (p *AlterIndex) Resolved() bool
- func (p *AlterIndex) RowIter(ctx *sql.Context, row sql.Row) (sql.RowIter, error)
- func (p *AlterIndex) Schema() sql.Schema
- func (p AlterIndex) String() string
- func (p *AlterIndex) WithChildren(children ...sql.Node) (sql.Node, error)
- type Begin
- type BeginEndBlock
- func (b *BeginEndBlock) Children() []sql.Node
- func (b *BeginEndBlock) DebugString() string
- func (b *BeginEndBlock) Resolved() bool
- func (b *BeginEndBlock) RowIter(ctx *sql.Context, row sql.Row) (sql.RowIter, error)
- func (b *BeginEndBlock) Schema() sql.Schema
- func (b *BeginEndBlock) String() string
- func (b *BeginEndBlock) WithChildren(node ...sql.Node) (sql.Node, error)
- type BinaryNode
- type ChildSelector
- type Commit
- type CreateForeignKey
- func (p *CreateForeignKey) Execute(ctx *sql.Context) error
- func (p *CreateForeignKey) RowIter(ctx *sql.Context, row sql.Row) (sql.RowIter, error)
- func (p *CreateForeignKey) Schema() sql.Schema
- func (p CreateForeignKey) String() string
- func (p *CreateForeignKey) WithChildren(children ...sql.Node) (sql.Node, error)
- 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, row sql.Row) (sql.RowIter, error)
- func (c *CreateIndex) Schema() sql.Schema
- func (c *CreateIndex) String() string
- func (c *CreateIndex) WithChildren(children ...sql.Node) (sql.Node, error)
- func (c *CreateIndex) WithExpressions(exprs ...sql.Expression) (sql.Node, error)
- type CreateTable
- func (c *CreateTable) Children() []sql.Node
- func (c *CreateTable) Database() sql.Database
- func (c *CreateTable) Expressions() []sql.Expression
- func (c *CreateTable) IfNotExists() bool
- func (c *CreateTable) Like() sql.Node
- func (c *CreateTable) Name() string
- func (c *CreateTable) Resolved() bool
- func (c *CreateTable) RowIter(ctx *sql.Context, row sql.Row) (sql.RowIter, error)
- func (c *CreateTable) Schema() sql.Schema
- func (c *CreateTable) String() string
- func (c *CreateTable) WithChildren(children ...sql.Node) (sql.Node, error)
- func (c *CreateTable) WithDatabase(db sql.Database) (sql.Node, error)
- func (c *CreateTable) WithExpressions(exprs ...sql.Expression) (sql.Node, error)
- type CreateTrigger
- func (c *CreateTrigger) Children() []sql.Node
- func (c *CreateTrigger) Database() sql.Database
- func (c *CreateTrigger) DebugString() string
- func (c *CreateTrigger) Resolved() bool
- func (c *CreateTrigger) RowIter(ctx *sql.Context, row sql.Row) (sql.RowIter, error)
- func (c *CreateTrigger) Schema() sql.Schema
- func (c *CreateTrigger) String() string
- func (c *CreateTrigger) WithChildren(children ...sql.Node) (sql.Node, error)
- func (c *CreateTrigger) WithDatabase(database sql.Database) (sql.Node, error)
- type CreateView
- func (cv *CreateView) Children() []sql.Node
- func (cv *CreateView) Database() sql.Database
- func (cv *CreateView) Resolved() bool
- func (cv *CreateView) RowIter(ctx *sql.Context, row sql.Row) (sql.RowIter, error)
- func (cv *CreateView) Schema() sql.Schema
- func (cv *CreateView) String() string
- func (cv *CreateView) View() sql.View
- func (cv *CreateView) WithChildren(children ...sql.Node) (sql.Node, error)
- func (cv *CreateView) WithDatabase(database sql.Database) (sql.Node, error)
- type CrossJoin
- func (p *CrossJoin) DebugString() string
- func (p *CrossJoin) Resolved() bool
- func (p *CrossJoin) RowIter(ctx *sql.Context, row sql.Row) (sql.RowIter, error)
- func (p *CrossJoin) Schema() sql.Schema
- func (p *CrossJoin) String() string
- func (p *CrossJoin) WithChildren(children ...sql.Node) (sql.Node, error)
- type DecoratedNode
- type DecorationType
- type DeleteFrom
- type Describe
- type DescribeQuery
- type Distinct
- type DropColumn
- func (c *DropColumn) Children() []sql.Node
- func (c *DropColumn) Database() sql.Database
- func (c *DropColumn) Resolved() bool
- func (d *DropColumn) RowIter(ctx *sql.Context, row sql.Row) (sql.RowIter, error)
- func (*DropColumn) Schema() sql.Schema
- func (d *DropColumn) String() string
- func (d *DropColumn) WithChildren(children ...sql.Node) (sql.Node, error)
- func (d *DropColumn) WithDatabase(db sql.Database) (sql.Node, error)
- type DropForeignKey
- func (p *DropForeignKey) Execute(ctx *sql.Context) error
- func (p *DropForeignKey) RowIter(ctx *sql.Context, row sql.Row) (sql.RowIter, error)
- func (p *DropForeignKey) Schema() sql.Schema
- func (p DropForeignKey) String() string
- func (p *DropForeignKey) WithChildren(children ...sql.Node) (sql.Node, error)
- type DropIndex
- func (d *DropIndex) Children() []sql.Node
- func (d *DropIndex) Resolved() bool
- func (d *DropIndex) RowIter(ctx *sql.Context, row sql.Row) (sql.RowIter, error)
- func (d *DropIndex) Schema() sql.Schema
- func (d *DropIndex) String() string
- func (d *DropIndex) WithChildren(children ...sql.Node) (sql.Node, error)
- type DropTable
- func (c *DropTable) Children() []sql.Node
- func (c *DropTable) Database() sql.Database
- func (c *DropTable) Resolved() bool
- func (d *DropTable) RowIter(ctx *sql.Context, row sql.Row) (sql.RowIter, error)
- func (*DropTable) Schema() sql.Schema
- func (d *DropTable) String() string
- func (d *DropTable) TableNames() []string
- func (d *DropTable) WithChildren(children ...sql.Node) (sql.Node, error)
- func (d *DropTable) WithDatabase(db sql.Database) (sql.Node, error)
- func (d *DropTable) WithTriggers(triggers []string) sql.Node
- type DropTrigger
- func (d *DropTrigger) Children() []sql.Node
- func (d *DropTrigger) Database() sql.Database
- func (d *DropTrigger) Resolved() bool
- func (d *DropTrigger) RowIter(ctx *sql.Context, row sql.Row) (sql.RowIter, error)
- func (d *DropTrigger) Schema() sql.Schema
- func (d *DropTrigger) String() string
- func (d *DropTrigger) WithChildren(children ...sql.Node) (sql.Node, error)
- func (d *DropTrigger) WithDatabase(db sql.Database) (sql.Node, error)
- type DropView
- func (dvs *DropView) Children() []sql.Node
- func (dvs *DropView) Resolved() bool
- func (dvs *DropView) RowIter(ctx *sql.Context, row sql.Row) (sql.RowIter, error)
- func (dvs *DropView) Schema() sql.Schema
- func (dvs *DropView) String() string
- func (dvs *DropView) WithChildren(children ...sql.Node) (sql.Node, error)
- type DummyResolvedDB
- func (d *DummyResolvedDB) AddTable(name string, t sql.Table)
- func (d *DummyResolvedDB) CreateTable(ctx *sql.Context, name string, schema sql.Schema) error
- func (d *DummyResolvedDB) DropTable(ctx *sql.Context, name string) error
- func (d *DummyResolvedDB) GetTableInsensitive(ctx *sql.Context, tblName string) (sql.Table, bool, error)
- func (d *DummyResolvedDB) GetTableNames(ctx *sql.Context) ([]string, error)
- func (d *DummyResolvedDB) Name() string
- func (d *DummyResolvedDB) RenameTable(ctx *sql.Context, oldName, newName string) error
- func (d *DummyResolvedDB) Tables() map[string]sql.Table
- type EvalPartitionKeyValueIter
- type Exchange
- type Filter
- func (f *Filter) DebugString() string
- func (f *Filter) Expressions() []sql.Expression
- func (f *Filter) Resolved() bool
- func (f *Filter) RowIter(ctx *sql.Context, row sql.Row) (sql.RowIter, error)
- func (f *Filter) String() string
- func (f *Filter) WithChildren(children ...sql.Node) (sql.Node, error)
- func (f *Filter) WithExpressions(exprs ...sql.Expression) (sql.Node, error)
- type FilterIter
- type Generate
- func (g *Generate) Expressions() []sql.Expression
- func (g *Generate) RowIter(ctx *sql.Context, row sql.Row) (sql.RowIter, error)
- func (g *Generate) Schema() sql.Schema
- func (g *Generate) String() string
- func (g *Generate) WithChildren(children ...sql.Node) (sql.Node, error)
- func (g *Generate) WithExpressions(exprs ...sql.Expression) (sql.Node, error)
- type GroupBy
- func (g *GroupBy) DebugString() string
- func (g *GroupBy) Expressions() []sql.Expression
- func (g *GroupBy) Resolved() bool
- func (g *GroupBy) RowIter(ctx *sql.Context, row sql.Row) (sql.RowIter, error)
- func (g *GroupBy) Schema() sql.Schema
- func (g *GroupBy) String() string
- func (g *GroupBy) WithChildren(children ...sql.Node) (sql.Node, error)
- func (g *GroupBy) WithExpressions(exprs ...sql.Expression) (sql.Node, error)
- type Having
- func (h *Having) Expressions() []sql.Expression
- func (h *Having) Resolved() bool
- func (h *Having) RowIter(ctx *sql.Context, row sql.Row) (sql.RowIter, error)
- func (h *Having) String() string
- func (h *Having) WithChildren(children ...sql.Node) (sql.Node, error)
- func (h *Having) WithExpressions(exprs ...sql.Expression) (sql.Node, error)
- type InSubquery
- func (in *InSubquery) Children() []sql.Expression
- func (in *InSubquery) DebugString() string
- func (in *InSubquery) Eval(ctx *sql.Context, row sql.Row) (interface{}, error)
- func (in *InSubquery) String() string
- func (in *InSubquery) Type() sql.Type
- func (in *InSubquery) WithChildren(children ...sql.Expression) (sql.Expression, error)
- type IndexAction
- type IndexDefinition
- type IndexedJoin
- func (ij *IndexedJoin) DebugString() string
- func (ij *IndexedJoin) JoinType() JoinType
- func (ij *IndexedJoin) RowIter(ctx *sql.Context, row sql.Row) (sql.RowIter, error)
- func (ij *IndexedJoin) Schema() sql.Schema
- func (ij *IndexedJoin) String() string
- func (ij *IndexedJoin) WithChildren(children ...sql.Node) (sql.Node, error)
- type IndexedTableAccess
- func (i *IndexedTableAccess) DebugString() string
- func (i *IndexedTableAccess) Expressions() []sql.Expression
- func (i *IndexedTableAccess) RowIter(ctx *sql.Context, row sql.Row) (sql.RowIter, error)
- func (i *IndexedTableAccess) String() string
- func (i *IndexedTableAccess) WithChildren(children ...sql.Node) (sql.Node, error)
- func (i *IndexedTableAccess) WithExpressions(exprs ...sql.Expression) (sql.Node, error)
- type InnerJoin
- func (j *InnerJoin) DebugString() string
- func (j *InnerJoin) Expressions() []sql.Expression
- func (j *InnerJoin) JoinCond() sql.Expression
- func (j *InnerJoin) JoinType() JoinType
- func (j *InnerJoin) Resolved() bool
- func (j *InnerJoin) RowIter(ctx *sql.Context, row sql.Row) (sql.RowIter, error)
- func (j *InnerJoin) Schema() sql.Schema
- func (j *InnerJoin) String() string
- func (j *InnerJoin) WithChildren(children ...sql.Node) (sql.Node, error)
- func (j *InnerJoin) WithExpressions(exprs ...sql.Expression) (sql.Node, error)
- type InsertInto
- func (p InsertInto) DebugString() string
- func (p *InsertInto) Expressions() []sql.Expression
- func (p *InsertInto) Resolved() bool
- func (p *InsertInto) RowIter(ctx *sql.Context, row sql.Row) (sql.RowIter, error)
- func (p *InsertInto) Schema() sql.Schema
- func (p InsertInto) String() string
- func (p *InsertInto) WithChildren(children ...sql.Node) (sql.Node, error)
- func (p *InsertInto) WithExpressions(newExprs ...sql.Expression) (sql.Node, error)
- type JoinNode
- type JoinType
- type LeftJoin
- func (j *LeftJoin) DebugString() string
- func (j *LeftJoin) Expressions() []sql.Expression
- func (j *LeftJoin) JoinCond() sql.Expression
- func (j *LeftJoin) JoinType() JoinType
- func (j *LeftJoin) Resolved() bool
- func (j *LeftJoin) RowIter(ctx *sql.Context, row sql.Row) (sql.RowIter, error)
- func (j *LeftJoin) Schema() sql.Schema
- func (j *LeftJoin) String() string
- func (j *LeftJoin) WithChildren(children ...sql.Node) (sql.Node, error)
- func (j *LeftJoin) WithExpressions(exprs ...sql.Expression) (sql.Node, error)
- type Limit
- type LockTables
- func (t *LockTables) Children() []sql.Node
- func (t *LockTables) Resolved() bool
- func (t *LockTables) RowIter(ctx *sql.Context, row sql.Row) (sql.RowIter, error)
- func (t *LockTables) Schema() sql.Schema
- func (t *LockTables) String() string
- func (t *LockTables) WithChildren(children ...sql.Node) (sql.Node, error)
- type ModifyColumn
- func (c *ModifyColumn) Children() []sql.Node
- func (m *ModifyColumn) Column() *sql.Column
- func (c *ModifyColumn) Database() sql.Database
- func (m *ModifyColumn) Expressions() []sql.Expression
- func (m *ModifyColumn) Order() *sql.ColumnOrder
- func (m *ModifyColumn) Resolved() bool
- func (m *ModifyColumn) RowIter(ctx *sql.Context, row sql.Row) (sql.RowIter, error)
- func (m *ModifyColumn) Schema() sql.Schema
- func (m *ModifyColumn) String() string
- func (m *ModifyColumn) TableName() string
- func (m *ModifyColumn) WithChildren(children ...sql.Node) (sql.Node, error)
- func (m *ModifyColumn) WithDatabase(db sql.Database) (sql.Node, error)
- func (m *ModifyColumn) WithExpressions(exprs ...sql.Expression) (sql.Node, error)
- type NameAndSchema
- type NamedNotifyFunc
- type NaturalJoin
- type NotifyFunc
- type NullOrdering
- type Offset
- type OrderedDistinct
- type ProcessIndexableTable
- type ProcessTable
- type Project
- func (p *Project) DebugString() string
- func (p *Project) Expressions() []sql.Expression
- func (p *Project) Resolved() bool
- func (p *Project) RowIter(ctx *sql.Context, row sql.Row) (sql.RowIter, error)
- func (p *Project) Schema() sql.Schema
- func (p *Project) String() string
- func (p *Project) WithChildren(children ...sql.Node) (sql.Node, error)
- func (p *Project) WithExpressions(exprs ...sql.Expression) (sql.Node, error)
- type QueryProcess
- type RenameColumn
- func (c *RenameColumn) Children() []sql.Node
- func (c *RenameColumn) Database() sql.Database
- func (c *RenameColumn) Resolved() bool
- func (r *RenameColumn) RowIter(ctx *sql.Context, row sql.Row) (sql.RowIter, error)
- func (*RenameColumn) Schema() sql.Schema
- func (r *RenameColumn) String() string
- func (r *RenameColumn) WithChildren(children ...sql.Node) (sql.Node, error)
- func (r *RenameColumn) WithDatabase(db sql.Database) (sql.Node, error)
- type RenameTable
- func (c *RenameTable) Children() []sql.Node
- func (c *RenameTable) Database() sql.Database
- func (c *RenameTable) Resolved() bool
- func (r *RenameTable) RowIter(ctx *sql.Context, row sql.Row) (sql.RowIter, error)
- func (*RenameTable) Schema() sql.Schema
- func (r *RenameTable) String() string
- func (r *RenameTable) WithChildren(children ...sql.Node) (sql.Node, error)
- func (r *RenameTable) WithDatabase(db sql.Database) (sql.Node, error)
- type ResolvedTable
- func (*ResolvedTable) Children() []sql.Node
- func (t *ResolvedTable) DebugString() string
- func (*ResolvedTable) Resolved() bool
- func (t *ResolvedTable) RowIter(ctx *sql.Context, row sql.Row) (sql.RowIter, error)
- func (t *ResolvedTable) String() string
- func (t *ResolvedTable) WithChildren(children ...sql.Node) (sql.Node, error)
- type RightJoin
- func (j *RightJoin) DebugString() string
- func (j *RightJoin) Expressions() []sql.Expression
- func (j *RightJoin) JoinCond() sql.Expression
- func (j *RightJoin) JoinType() JoinType
- func (j *RightJoin) Resolved() bool
- func (j *RightJoin) RowIter(ctx *sql.Context, row sql.Row) (sql.RowIter, error)
- func (j *RightJoin) Schema() sql.Schema
- func (j *RightJoin) String() string
- func (j *RightJoin) WithChildren(children ...sql.Node) (sql.Node, error)
- func (j *RightJoin) WithExpressions(exprs ...sql.Expression) (sql.Node, error)
- type Rollback
- type RowUpdateAccumulator
- func (r RowUpdateAccumulator) DebugString() string
- func (r RowUpdateAccumulator) RowIter(ctx *sql.Context, row sql.Row) (sql.RowIter, error)
- func (r RowUpdateAccumulator) Schema() sql.Schema
- func (r RowUpdateAccumulator) String() string
- func (r RowUpdateAccumulator) WithChildren(children ...sql.Node) (sql.Node, error)
- type RowUpdateType
- type Set
- func (s *Set) Children() []sql.Node
- func (s *Set) DebugString() string
- func (s *Set) Expressions() []sql.Expression
- func (s *Set) Resolved() bool
- func (s *Set) RowIter(ctx *sql.Context, row sql.Row) (sql.RowIter, error)
- func (s *Set) Schema() sql.Schema
- func (s *Set) String() string
- func (s *Set) WithChildren(children ...sql.Node) (sql.Node, error)
- func (s *Set) WithExpressions(exprs ...sql.Expression) (sql.Node, error)
- type ShowColumns
- type ShowCreateDatabase
- func (s *ShowCreateDatabase) Children() []sql.Node
- func (s *ShowCreateDatabase) Database() sql.Database
- func (s *ShowCreateDatabase) Resolved() bool
- func (s *ShowCreateDatabase) RowIter(ctx *sql.Context, row sql.Row) (sql.RowIter, error)
- func (s *ShowCreateDatabase) Schema() sql.Schema
- func (s *ShowCreateDatabase) String() string
- func (s *ShowCreateDatabase) WithChildren(children ...sql.Node) (sql.Node, error)
- func (s *ShowCreateDatabase) WithDatabase(db sql.Database) (sql.Node, error)
- type ShowCreateTable
- type ShowCreateTrigger
- func (s *ShowCreateTrigger) Children() []sql.Node
- func (s *ShowCreateTrigger) Database() sql.Database
- func (s *ShowCreateTrigger) Resolved() bool
- func (s *ShowCreateTrigger) RowIter(ctx *sql.Context, row sql.Row) (sql.RowIter, error)
- func (s *ShowCreateTrigger) Schema() sql.Schema
- func (s *ShowCreateTrigger) String() string
- func (s *ShowCreateTrigger) WithChildren(children ...sql.Node) (sql.Node, error)
- func (s *ShowCreateTrigger) WithDatabase(db sql.Database) (sql.Node, error)
- type ShowDatabases
- func (*ShowDatabases) Children() []sql.Node
- func (p *ShowDatabases) Resolved() bool
- func (p *ShowDatabases) RowIter(ctx *sql.Context, row sql.Row) (sql.RowIter, error)
- func (*ShowDatabases) Schema() sql.Schema
- func (p ShowDatabases) String() string
- func (p *ShowDatabases) WithChildren(children ...sql.Node) (sql.Node, error)
- type ShowIndexes
- type ShowProcessList
- func (p *ShowProcessList) Children() []sql.Node
- func (p *ShowProcessList) Resolved() bool
- func (p *ShowProcessList) RowIter(ctx *sql.Context, row sql.Row) (sql.RowIter, error)
- func (p *ShowProcessList) Schema() sql.Schema
- func (p *ShowProcessList) String() string
- func (p *ShowProcessList) WithChildren(children ...sql.Node) (sql.Node, error)
- type ShowTableStatus
- func (s *ShowTableStatus) Children() []sql.Node
- func (s *ShowTableStatus) Resolved() bool
- func (s *ShowTableStatus) RowIter(ctx *sql.Context, row sql.Row) (sql.RowIter, error)
- func (s *ShowTableStatus) Schema() sql.Schema
- func (s *ShowTableStatus) String() string
- func (s *ShowTableStatus) WithChildren(children ...sql.Node) (sql.Node, error)
- type ShowTables
- func (*ShowTables) Children() []sql.Node
- func (p *ShowTables) Database() sql.Database
- func (p *ShowTables) Expressions() []sql.Expression
- func (p *ShowTables) Resolved() bool
- func (p *ShowTables) RowIter(ctx *sql.Context, row sql.Row) (sql.RowIter, error)
- func (p *ShowTables) Schema() sql.Schema
- func (p ShowTables) String() string
- func (p *ShowTables) WithChildren(children ...sql.Node) (sql.Node, error)
- func (p *ShowTables) WithDatabase(db sql.Database) (sql.Node, error)
- func (p *ShowTables) WithExpressions(exprs ...sql.Expression) (sql.Node, error)
- type ShowTriggers
- func (s *ShowTriggers) Children() []sql.Node
- func (s *ShowTriggers) Database() sql.Database
- func (s *ShowTriggers) Resolved() bool
- func (s *ShowTriggers) RowIter(ctx *sql.Context, row sql.Row) (sql.RowIter, error)
- func (s *ShowTriggers) Schema() sql.Schema
- func (s *ShowTriggers) String() string
- func (s *ShowTriggers) WithChildren(children ...sql.Node) (sql.Node, error)
- func (s *ShowTriggers) WithDatabase(db sql.Database) (sql.Node, error)
- type ShowVariables
- func (*ShowVariables) Children() []sql.Node
- func (sv *ShowVariables) Resolved() bool
- func (sv *ShowVariables) RowIter(ctx *sql.Context, row sql.Row) (sql.RowIter, error)
- func (*ShowVariables) Schema() sql.Schema
- func (sv *ShowVariables) String() string
- func (sv *ShowVariables) WithChildren(children ...sql.Node) (sql.Node, error)
- type ShowWarnings
- func (ShowWarnings) Children() []sql.Node
- func (ShowWarnings) Resolved() bool
- func (sw ShowWarnings) RowIter(ctx *sql.Context, row sql.Row) (sql.RowIter, error)
- func (ShowWarnings) Schema() sql.Schema
- func (ShowWarnings) String() string
- func (sw ShowWarnings) WithChildren(children ...sql.Node) (sql.Node, error)
- type SingleDropView
- func (dv *SingleDropView) Children() []sql.Node
- func (dv *SingleDropView) Database() sql.Database
- func (dv *SingleDropView) Resolved() bool
- func (dv *SingleDropView) RowIter(ctx *sql.Context, row sql.Row) (sql.RowIter, error)
- func (dv *SingleDropView) Schema() sql.Schema
- func (dv *SingleDropView) String() string
- func (dv *SingleDropView) WithChildren(children ...sql.Node) (sql.Node, error)
- func (dv *SingleDropView) WithDatabase(database sql.Database) (sql.Node, error)
- type Sort
- func (s *Sort) DebugString() string
- func (s *Sort) Expressions() []sql.Expression
- func (s *Sort) Resolved() bool
- func (s *Sort) RowIter(ctx *sql.Context, row sql.Row) (sql.RowIter, error)
- func (s *Sort) String() string
- func (s *Sort) WithChildren(children ...sql.Node) (sql.Node, error)
- func (s *Sort) WithExpressions(exprs ...sql.Expression) (sql.Node, error)
- type SortField
- type SortOrder
- type Sorter
- type Subquery
- func (s *Subquery) Children() []sql.Expression
- func (s *Subquery) DebugString() string
- func (s *Subquery) Dispose()
- func (s *Subquery) Eval(ctx *sql.Context, row sql.Row) (interface{}, error)
- func (s *Subquery) EvalMultiple(ctx *sql.Context, row sql.Row) ([]interface{}, error)
- func (s *Subquery) HashMultiple(ctx *sql.Context, row sql.Row) (sql.KeyValueCache, error)
- func (s *Subquery) IsNonDeterministic() bool
- func (s *Subquery) IsNullable() bool
- func (s *Subquery) Resolved() bool
- func (s *Subquery) String() string
- func (s *Subquery) Type() sql.Type
- func (s *Subquery) WithCachedResults() *Subquery
- func (s *Subquery) WithChildren(children ...sql.Expression) (sql.Expression, error)
- func (s *Subquery) WithQuery(node sql.Node) *Subquery
- type SubqueryAlias
- func (n *SubqueryAlias) AsView() sql.View
- func (n SubqueryAlias) DebugString() string
- func (n *SubqueryAlias) Name() string
- func (n *SubqueryAlias) Opaque() bool
- func (n *SubqueryAlias) RowIter(ctx *sql.Context, row sql.Row) (sql.RowIter, error)
- func (n *SubqueryAlias) Schema() sql.Schema
- func (n SubqueryAlias) String() string
- func (n *SubqueryAlias) WithChildren(children ...sql.Node) (sql.Node, error)
- type TableAlias
- func (t TableAlias) DebugString() string
- func (t *TableAlias) Name() string
- func (t *TableAlias) RowIter(ctx *sql.Context, row sql.Row) (sql.RowIter, error)
- func (t *TableAlias) Schema() sql.Schema
- func (t TableAlias) String() string
- func (t *TableAlias) WithChildren(children ...sql.Node) (sql.Node, error)
- type TableLock
- type TransformNodeWithParentFunc
- type TriggerEvent
- type TriggerExecutor
- type TriggerOrder
- type TriggerTime
- type Truncate
- func (p *Truncate) DatabaseName() string
- func (p Truncate) DebugString() string
- func (p *Truncate) RowIter(ctx *sql.Context, _ sql.Row) (sql.RowIter, error)
- func (p *Truncate) Schema() sql.Schema
- func (p Truncate) String() string
- func (p *Truncate) WithChildren(children ...sql.Node) (sql.Node, error)
- type UnaryNode
- type Union
- type UnlockTables
- func (t *UnlockTables) Children() []sql.Node
- func (t *UnlockTables) Resolved() bool
- func (t *UnlockTables) RowIter(ctx *sql.Context, row sql.Row) (sql.RowIter, error)
- func (t *UnlockTables) Schema() sql.Schema
- func (t *UnlockTables) String() string
- func (t *UnlockTables) WithChildren(children ...sql.Node) (sql.Node, error)
- type UnresolvedTable
- func (*UnresolvedTable) Children() []sql.Node
- func (t *UnresolvedTable) Name() string
- func (*UnresolvedTable) Resolved() bool
- func (*UnresolvedTable) RowIter(ctx *sql.Context, row sql.Row) (sql.RowIter, error)
- func (*UnresolvedTable) Schema() sql.Schema
- func (t UnresolvedTable) String() string
- func (t *UnresolvedTable) WithAsOf(asOf sql.Expression) (*UnresolvedTable, error)
- func (t *UnresolvedTable) WithChildren(children ...sql.Node) (sql.Node, error)
- func (t *UnresolvedTable) WithDatabase(database string) (*UnresolvedTable, error)
- type Update
- type UpdateInfo
- type UpdateSource
- func (u *UpdateSource) DebugString() string
- func (u *UpdateSource) Expressions() []sql.Expression
- func (u *UpdateSource) Resolved() bool
- func (u *UpdateSource) RowIter(ctx *sql.Context, row sql.Row) (sql.RowIter, error)
- func (u *UpdateSource) Schema() sql.Schema
- func (u *UpdateSource) String() string
- func (u *UpdateSource) WithChildren(children ...sql.Node) (sql.Node, error)
- func (u *UpdateSource) WithExpressions(newExprs ...sql.Expression) (sql.Node, error)
- type Use
- func (Use) Children() []sql.Node
- func (u *Use) Database() sql.Database
- func (u *Use) Resolved() bool
- func (u *Use) RowIter(ctx *sql.Context, row sql.Row) (sql.RowIter, error)
- func (Use) Schema() sql.Schema
- func (u *Use) String() string
- func (u *Use) WithChildren(children ...sql.Node) (sql.Node, error)
- func (u *Use) WithDatabase(db sql.Database) (sql.Node, error)
- type Values
- func (p *Values) Children() []sql.Node
- func (p *Values) DebugString() string
- func (p *Values) Expressions() []sql.Expression
- func (p *Values) Resolved() bool
- func (p *Values) RowIter(ctx *sql.Context, row sql.Row) (sql.RowIter, error)
- func (p *Values) Schema() sql.Schema
- func (p *Values) String() string
- func (p *Values) WithChildren(children ...sql.Node) (sql.Node, error)
- func (p *Values) WithExpressions(exprs ...sql.Expression) (sql.Node, error)
- type Visitor
Constants ¶
const ( InsertTrigger TriggerEvent = "insert" UpdateTrigger = "update" DeleteTrigger = "delete" )
Variables ¶
var ( // ErrNoForeignKeySupport is returned when the table does not support FOREIGN KEY operations. ErrNoForeignKeySupport = errors.NewKind("the table does not support foreign key operations: %s") // ErrForeignKeyMissingColumns is returned when an ALTER TABLE ADD FOREIGN KEY statement does not provide any columns ErrForeignKeyMissingColumns = errors.NewKind("cannot create a foreign key without columns") // ErrAddForeignKeyDuplicateColumn is returned when an ALTER TABLE ADD FOREIGN KEY statement has the same column multiple times ErrAddForeignKeyDuplicateColumn = errors.NewKind("cannot have duplicates of columns in a foreign key: `%v`") )
var ( // ErrIndexActionNotImplemented is returned when the action has not been implemented ErrIndexActionNotImplemented = errors.NewKind("alter table index action is not implemented: %v") // ErrCreateIndexMissingColumns is returned when a CREATE INDEX statement does not provide any columns ErrCreateIndexMissingColumns = errors.NewKind("cannot create an index without columns") // ErrCreateIndexNonExistentColumn is returned when a key is provided in the index that isn't in the table ErrCreateIndexNonExistentColumn = errors.NewKind("column `%v` does not exist in the table") // ErrCreateIndexDuplicateColumn is returned when a CREATE INDEX statement has the same column multiple times ErrCreateIndexDuplicateColumn = errors.NewKind("cannot have duplicates of columns in an index: `%v`") )
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") // ErrExprTypeNotIndexable is returned when the expression type cannot be // indexed, such as BLOB or JSON. ErrExprTypeNotIndexable = errors.NewKind("expression %q with type %s cannot be indexed") )
var ( // ErrIndexNotFound is returned when the index cannot be found. ErrIndexNotFound = errors.NewKind("unable to find index %q on table %q of database %q") // ErrTableNotValid is returned when the table is not valid ErrTableNotValid = errors.NewKind("table is not valid") // ErrTableNotNameable is returned when the table is not nameable. ErrTableNotNameable = errors.NewKind("can't get name from table") // ErrIndexNotAvailable is returned when trying to delete an index that is // still not ready for usage. ErrIndexNotAvailable = errors.NewKind("index %q is still not ready for usage and can't be deleted") )
var DescribeSchema = sql.Schema{ {Name: "plan", Type: sql.LongText}, }
DescribeSchema is the schema returned by a DescribeQuery node.
var EmptyTable = new(emptyTable)
EmptyTable is a node representing an empty table.
var ErrAlterTableNotSupported = errors.NewKind("table %s cannot be altered on database %s")
ErrAlterTableNotSupported is thrown when the database doesn't support ALTER TABLE statements
var ErrAutoIncrementNotSupported = errors.NewKind("table doesn't support AUTO_INCREMENT")
var ErrCreateTableNotSupported = errors.NewKind("tables cannot be created on database %s")
ErrCreateTable is thrown when the database doesn't support table creation
var ErrDeleteFromNotSupported = errors.NewKind("table doesn't support DELETE FROM")
var ErrDropTableNotSupported = errors.NewKind("tables cannot be dropped on database %s")
ErrDropTableNotSupported is thrown when the database doesn't support dropping tables
var ErrGroupBy = errors.NewKind("group by aggregation '%v' not supported")
ErrGroupBy is returned when the aggregation is not supported.
var ErrInsertIntoDuplicateColumn = errors.NewKind("duplicate column name %v")
var ErrInsertIntoIncompatibleTypes = errors.NewKind("cannot convert type %s to %s")
var ErrInsertIntoMismatchValueCount = errors.NewKind("number of values does not match number of columns provided")
var ErrInsertIntoNonNullableDefaultNullColumn = errors.NewKind("column name '%v' is non-nullable but attempted to set default value of null")
var ErrInsertIntoNonNullableProvidedNull = errors.NewKind("column name '%v' is non-nullable but attempted to set a value of null")
var ErrInsertIntoNonexistentColumn = errors.NewKind("invalid column name %v")
var ErrInsertIntoNotSupported = errors.NewKind("table doesn't support INSERT INTO")
ErrInsertIntoNotSupported is thrown when a table doesn't support inserts
var ErrInsertIntoUnsupportedValues = errors.NewKind("%T is unsupported for inserts")
var ErrNoIndexableTable = errors.NewKind("expected an IndexableTable, couldn't find one in %v")
var ErrNoIndexedTableAccess = errors.NewKind("expected an IndexedTableAccess, couldn't find one in %v")
var ErrNoPartitionable = errors.NewKind("no partitionable node found in exchange tree")
ErrNoPartitionable is returned when no Partitionable node is found in the Exchange tree.
var ErrNotView = errors.NewKind("'%' is not VIEW")
var ErrNullDefault = errors.NewKind("column declared not null must have a non-null default value")
ErrNullDefault is thrown when a non-null column is added with a null default
var ErrOnDuplicateKeyUpdateNotSupported = errors.NewKind("table doesn't support ON DUPLICATE KEY UPDATE")
var ErrRenameTableNotSupported = errors.NewKind("tables cannot be renamed on database %s")
ErrRenameTableNotSupported is thrown when the database doesn't support renaming tables
var ErrReplaceIntoNotSupported = errors.NewKind("table doesn't support REPLACE INTO")
var ErrTableCreatedNotFound = errors.NewKind("table was created but could not be found")
ErrTableCreatedNotFound is thrown when a table is created from CREATE TABLE but cannot be found immediately afterward
var ErrTableNotLockable = errors.NewKind("table %s is not lockable")
ErrTableNotLockable is returned whenever a lockable table can't be found.
var ErrTruncateNotSupported = errors.NewKind("table doesn't support TRUNCATE")
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
var ErrUnsupportedFeature = errors.NewKind("unsupported feature: %s")
ErrUnsupportedFeature is thrown when a feature is not already supported
var ErrUpdateNotSupported = errors.NewKind("table doesn't support UPDATE")
var ErrUpdateUnexpectedSetResult = errors.NewKind("attempted to set field but expression returned %T")
var Nothing nothing
Nothing is a node that will return no rows.
Functions ¶
func ApplyBindings ¶
ApplyBindings replaces all `BindVar` expressions in the given sql.Node with their corresponding sql.Expression entries in the provided |bindings| map. If a binding for a |BindVar| expression is not found in the map, no error is returned and the |BindVar| expression is left in place. There is no check on whether all entries in |bindings| are used at least once throughout the |n|.
This applies binding substitutions across *SubqueryAlias nodes, but will fail to apply bindings across other |sql.Opaque| nodes.
func GetColumnFromIndexExpr ¶
GetColumnFromIndexExpr returns column from the table given using the expression string given, in the form "table.column". Returns nil if the expression doesn't represent a column.
func GetColumnsAndPrepareExpressions ¶
func GetColumnsAndPrepareExpressions( exprs []sql.Expression, ) ([]string, []sql.Expression, error)
GetColumnsAndPrepareExpressions extracts the unique columns required by all those expressions and fixes the indexes of the GetFields in the expressions to match a row with only the returned columns in that same order.
func GetInsertable ¶
func GetInsertable(node sql.Node) (sql.InsertableTable, error)
func GetTruncatable ¶
func GetTruncatable(node sql.Node) (sql.TruncateableTable, error)
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 sql.Inspect on any expression it finds.
func InspectExpressionsWithNode ¶
InspectExpressionsWithNode traverses the plan and calls sql.Inspect on any expression it finds.
func NewNotInSubquery ¶
func NewNotInSubquery(left sql.Expression, right sql.Expression) sql.Expression
NewNotInSubquery creates a new NotInSubquery expression.
func NewShowCreateTable ¶
NewShowCreateTable creates a new ShowCreateTable node.
func NewShowIndexes ¶
NewShowIndexes creates a new ShowIndexes node. The node must represent a table.
func NillaryWithChildren ¶
NillaryNode is a node with no children. This is a common WithChildren implementation for all nodes that have none.
func ProjectRow ¶
ProjectRow evaluates a set of projections.
func TransformExpressions ¶
TransformExpressions applies a transformation function to all expressions on the given node.
func TransformExpressionsUp ¶
TransformExpressionsUp applies a transformation function to all expressions on the given tree from the bottom up.
func TransformExpressionsUpWithNode ¶
func TransformExpressionsUpWithNode(node sql.Node, f expression.TransformExprWithNodeFunc) (sql.Node, error)
TransformExpressionsUp applies a transformation function to all expressions on the given tree from the bottom up.
func TransformExpressionsWithNode ¶
func TransformExpressionsWithNode(n sql.Node, f expression.TransformExprWithNodeFunc) (sql.Node, error)
TransformExpressions applies a transformation function to all expressions on the given node.
func TransformUp ¶
TransformUp applies a transformation function to the given tree from the bottom up.
func TransformUpWithParent ¶
TransformUp applies a transformation function to the given tree from the bottom up, with the additional context of the parent node of the node under inspection.
func TransformUpWithSelector ¶
func TransformUpWithSelector(node sql.Node, selector ChildSelector, f sql.TransformNodeFunc) (sql.Node, error)
TransformUpWithSelector works like TransformUp, but allows the caller to decide which children of a node are walked.
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. If v.Visit(node) returns non-nil, then all children are walked, even if one of them returns nil for v.Visit().
func WalkExpressions ¶
WalkExpressions traverses the plan and calls sql.Walk on any expression it finds.
func WalkExpressionsWithNode ¶
func WalkExpressionsWithNode(v sql.NodeVisitor, n sql.Node)
WalkExpressionsWithNode traverses the plan and calls sql.WalkWithNode on any expression it finds.
Types ¶
type AddColumn ¶
type AddColumn struct {
// contains filtered or unexported fields
}
func NewAddColumn ¶
func (*AddColumn) Expressions ¶
func (a *AddColumn) Expressions() []sql.Expression
func (*AddColumn) Order ¶
func (a *AddColumn) Order() *sql.ColumnOrder
func (*AddColumn) WithChildren ¶
func (*AddColumn) WithDatabase ¶
func (*AddColumn) WithExpressions ¶
type AlterAutoIncrement ¶
type AlterAutoIncrement struct { UnaryNode // contains filtered or unexported fields }
func NewAlterAutoIncrement ¶
func NewAlterAutoIncrement(table sql.Node, autoVal int64) *AlterAutoIncrement
func (*AlterAutoIncrement) Execute ¶
func (p *AlterAutoIncrement) Execute(ctx *sql.Context) error
Execute inserts the rows in the database.
func (*AlterAutoIncrement) Schema ¶
func (p *AlterAutoIncrement) Schema() sql.Schema
func (AlterAutoIncrement) String ¶
func (p AlterAutoIncrement) String() string
func (*AlterAutoIncrement) WithChildren ¶
WithChildren implements the Node interface.
type AlterIndex ¶
type AlterIndex struct { // Action states whether it's a CREATE, DROP, or RENAME Action IndexAction // Table is the table that is being referenced Table sql.Node // IndexName is the index name, and in the case of a RENAME it represents the new name IndexName string // PreviousIndexName states the old name when renaming an index PreviousIndexName string // Using states whether you're using BTREE, HASH, or none Using sql.IndexUsing // Constraint specifies whether this is UNIQUE, FULLTEXT, SPATIAL, or none Constraint sql.IndexConstraint // Columns contains the column names (and possibly lengths) when creating an index Columns []sql.IndexColumn // Comment is the comment that was left at index creation, if any Comment string }
func NewAlterCreateIndex ¶
func NewAlterCreateIndex(table sql.Node, indexName string, using sql.IndexUsing, constraint sql.IndexConstraint, columns []sql.IndexColumn, comment string) *AlterIndex
func NewAlterDropIndex ¶
func NewAlterDropIndex(table sql.Node, indexName string) *AlterIndex
func NewAlterRenameIndex ¶
func NewAlterRenameIndex(table sql.Node, fromIndexName, toIndexName string) *AlterIndex
func (*AlterIndex) Children ¶
func (p *AlterIndex) Children() []sql.Node
func (*AlterIndex) Execute ¶
func (p *AlterIndex) Execute(ctx *sql.Context) error
Execute inserts the rows in the database.
func (*AlterIndex) Resolved ¶
func (p *AlterIndex) Resolved() bool
func (*AlterIndex) Schema ¶
func (p *AlterIndex) Schema() sql.Schema
Schema implements the Node interface.
func (AlterIndex) String ¶
func (p AlterIndex) String() string
func (*AlterIndex) WithChildren ¶
WithChildren implements the Node interface.
type Begin ¶
type Begin struct{}
Begin starts a transaction. This is provided just for compatibility with SQL clients and is a no-op.
type BeginEndBlock ¶
type BeginEndBlock struct {
// contains filtered or unexported fields
}
func NewBeginEndBlock ¶
func NewBeginEndBlock(statements []sql.Node) *BeginEndBlock
func (*BeginEndBlock) Children ¶
func (b *BeginEndBlock) Children() []sql.Node
func (*BeginEndBlock) DebugString ¶
func (b *BeginEndBlock) DebugString() string
func (*BeginEndBlock) Resolved ¶
func (b *BeginEndBlock) Resolved() bool
func (*BeginEndBlock) Schema ¶
func (b *BeginEndBlock) Schema() sql.Schema
func (*BeginEndBlock) String ¶
func (b *BeginEndBlock) String() string
func (*BeginEndBlock) WithChildren ¶
type BinaryNode ¶
type BinaryNode struct {
// contains filtered or unexported fields
}
BinaryNode is a node with two children.
func (BinaryNode) Children ¶
func (n BinaryNode) Children() []sql.Node
Children implements the Node interface.
func (BinaryNode) Left ¶
func (n BinaryNode) Left() sql.Node
func (BinaryNode) Resolved ¶
func (n BinaryNode) Resolved() bool
Resolved implements the Resolvable interface.
func (BinaryNode) Right ¶
func (n BinaryNode) Right() sql.Node
type ChildSelector ¶
ChildSelector is a func that returns whether the child of a parent node should be walked as part of a transformation. If not, that child and its portion of the subtree is skipped.
type Commit ¶
type Commit struct{}
Commit commits the changes performed in a transaction. This is provided just for compatibility with SQL clients and is a no-op.
type CreateForeignKey ¶
type CreateForeignKey struct { BinaryNode // Left: child, Right: parent FkDef *sql.ForeignKeyConstraint }
func NewAlterAddForeignKey ¶
func NewAlterAddForeignKey(table, refTable sql.Node, fkDef *sql.ForeignKeyConstraint) *CreateForeignKey
func (*CreateForeignKey) Execute ¶
func (p *CreateForeignKey) Execute(ctx *sql.Context) error
Execute inserts the rows in the database.
func (*CreateForeignKey) Schema ¶
func (p *CreateForeignKey) Schema() sql.Schema
func (CreateForeignKey) String ¶
func (p CreateForeignKey) String() string
func (*CreateForeignKey) WithChildren ¶
WithChildren implements the Node 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) WithChildren ¶
WithChildren implements the Node interface.
func (*CreateIndex) WithExpressions ¶
func (c *CreateIndex) WithExpressions(exprs ...sql.Expression) (sql.Node, error)
WithExpressions implements the Expressioner interface.
type CreateTable ¶
type CreateTable struct {
// contains filtered or unexported fields
}
CreateTable is a node describing the creation of some table.
func NewCreateTable ¶
func NewCreateTable(db sql.Database, name string, schema sql.Schema, ifNotExists bool, idxDefs []*IndexDefinition, fkDefs []*sql.ForeignKeyConstraint) *CreateTable
NewCreateTable creates a new CreateTable node
func NewCreateTableLike ¶
func NewCreateTableLike(db sql.Database, name string, likeTable sql.Node, ifNotExists bool) *CreateTable
NewCreateTableLike creates a new CreateTable node for CREATE TABLE LIKE statements
func (*CreateTable) Children ¶
func (c *CreateTable) Children() []sql.Node
Children implements the Node interface.
func (*CreateTable) Expressions ¶
func (c *CreateTable) Expressions() []sql.Expression
func (*CreateTable) IfNotExists ¶
func (c *CreateTable) IfNotExists() bool
func (*CreateTable) Like ¶
func (c *CreateTable) Like() sql.Node
func (*CreateTable) Name ¶
func (c *CreateTable) Name() string
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 sql.Node interface.
func (*CreateTable) String ¶
func (c *CreateTable) String() string
func (*CreateTable) WithChildren ¶
WithChildren implements the Node interface.
func (*CreateTable) WithDatabase ¶
WithDatabase implements the sql.Databaser interface.
func (*CreateTable) WithExpressions ¶
func (c *CreateTable) WithExpressions(exprs ...sql.Expression) (sql.Node, error)
type CreateTrigger ¶
type CreateTrigger struct { TriggerName string TriggerTime string TriggerEvent string TriggerOrder *TriggerOrder Table sql.Node Body sql.Node CreateTriggerString string BodyString string CreateDatabase sql.Database }
func NewCreateTrigger ¶
func NewCreateTrigger(triggerName, triggerTime, triggerEvent string, triggerOrder *TriggerOrder, table sql.Node, body sql.Node, createTriggerString, bodyString string) *CreateTrigger
func (*CreateTrigger) Children ¶
func (c *CreateTrigger) Children() []sql.Node
func (*CreateTrigger) Database ¶
func (c *CreateTrigger) Database() sql.Database
func (*CreateTrigger) DebugString ¶
func (c *CreateTrigger) DebugString() string
func (*CreateTrigger) Resolved ¶
func (c *CreateTrigger) Resolved() bool
func (*CreateTrigger) Schema ¶
func (c *CreateTrigger) Schema() sql.Schema
func (*CreateTrigger) String ¶
func (c *CreateTrigger) String() string
func (*CreateTrigger) WithChildren ¶
func (*CreateTrigger) WithDatabase ¶
type CreateView ¶
type CreateView struct { UnaryNode Name string Columns []string Catalog *sql.Catalog IsReplace bool Definition *SubqueryAlias // contains filtered or unexported fields }
CreateView is a node representing the creation (or replacement) of a view, which is defined by the Child node. The Columns member represent the explicit columns specified by the query, if any.
func NewCreateView ¶
func NewCreateView( database sql.Database, name string, columns []string, definition *SubqueryAlias, isReplace bool, ) *CreateView
NewCreateView creates a CreateView node with the specified parameters, setting its catalog to nil.
func (*CreateView) Children ¶
func (cv *CreateView) Children() []sql.Node
Children implements the Node interface. It returns the Child of the CreateView node; i.e., the definition of the view that will be created.
func (*CreateView) Database ¶
func (cv *CreateView) Database() sql.Database
Database implements the Databaser interface, and it returns the database in which CreateView will create the view.
func (*CreateView) Resolved ¶
func (cv *CreateView) Resolved() bool
Resolved implements the Node interface. This node is resolved if and only if the database and the Child are both resolved.
func (*CreateView) RowIter ¶
RowIter implements the Node interface. When executed, this function creates (or replaces) the view. It can error if the CraeteView's IsReplace member is set to false and the view already exists. The RowIter returned is always empty.
func (*CreateView) Schema ¶
func (cv *CreateView) Schema() sql.Schema
Schema implements the Node interface. It always returns nil.
func (*CreateView) String ¶
func (cv *CreateView) String() string
String implements the fmt.Stringer interface, using sql.TreePrinter to generate the string.
func (*CreateView) View ¶
func (cv *CreateView) View() sql.View
View returns the view that will be created by this node.
func (*CreateView) WithChildren ¶
WithChildren implements the Node interface. It only succeeds if the length of the specified children equals 1.
func (*CreateView) WithDatabase ¶
Database implements the Databaser interface, and it returns a copy of this node with the specified database.
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) DebugString ¶
type DecoratedNode ¶
type DecoratedNode struct { UnaryNode // contains filtered or unexported fields }
DecoratedNode represents a plan node that has been decorated to illustrate some aspect of the query plan
func NewDecoratedNode ¶
func NewDecoratedNode(decoration string, node sql.Node) *DecoratedNode
NewDecoratedNode creates a new instance of DecoratedNode wrapping the node given, with the Deocration string given.
func (*DecoratedNode) DebugString ¶
func (n *DecoratedNode) DebugString() string
func (*DecoratedNode) String ¶
func (n *DecoratedNode) String() string
func (*DecoratedNode) WithChildren ¶
type DecorationType ¶
type DecorationType byte
type DeleteFrom ¶
type DeleteFrom struct {
UnaryNode
}
DeleteFrom is a node describing a deletion from some table.
func NewDeleteFrom ¶
func NewDeleteFrom(n sql.Node) *DeleteFrom
NewDeleteFrom creates a DeleteFrom node.
func (DeleteFrom) DebugString ¶
func (p DeleteFrom) DebugString() string
func (DeleteFrom) String ¶
func (p DeleteFrom) String() string
func (*DeleteFrom) WithChildren ¶
WithChildren implements the Node interface.
type Describe ¶
type Describe struct {
UnaryNode
}
Describe is a node that describes its children.
func NewDescribe ¶
NewDescribe creates a new Describe node.
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) DebugString ¶
func (d *DescribeQuery) DebugString() string
func (*DescribeQuery) Schema ¶
func (d *DescribeQuery) Schema() sql.Schema
Schema implements the Node interface.
func (*DescribeQuery) String ¶
func (d *DescribeQuery) String() string
func (*DescribeQuery) WithChildren ¶
WithChildren 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) DebugString ¶
type DropColumn ¶
type DropColumn struct {
// contains filtered or unexported fields
}
func NewDropColumn ¶
func NewDropColumn(db sql.Database, tableName string, column string) *DropColumn
func (*DropColumn) Resolved ¶
func (c *DropColumn) Resolved() bool
Resolved implements the Resolvable interface.
func (*DropColumn) String ¶
func (d *DropColumn) String() string
func (*DropColumn) WithChildren ¶
func (*DropColumn) WithDatabase ¶
type DropForeignKey ¶
type DropForeignKey struct { UnaryNode FkDef *sql.ForeignKeyConstraint }
func NewAlterDropForeignKey ¶
func NewAlterDropForeignKey(table sql.Node, fkDef *sql.ForeignKeyConstraint) *DropForeignKey
func (*DropForeignKey) Execute ¶
func (p *DropForeignKey) Execute(ctx *sql.Context) error
Execute inserts the rows in the database.
func (*DropForeignKey) Schema ¶
func (p *DropForeignKey) Schema() sql.Schema
func (DropForeignKey) String ¶
func (p DropForeignKey) String() string
func (*DropForeignKey) WithChildren ¶
WithChildren implements the Node interface.
type DropIndex ¶
DropIndex is a node to drop an index.
func NewDropIndex ¶
NewDropIndex creates a new DropIndex node.
type DropTable ¶
type DropTable struct {
// contains filtered or unexported fields
}
DropTable is a node describing dropping one or more tables
func NewDropTable ¶
NewDropTable creates a new DropTable node
func (*DropTable) Resolved ¶
func (c *DropTable) Resolved() bool
Resolved implements the Resolvable interface.
func (*DropTable) TableNames ¶
TableNames returns the names of the tables to drop.
func (*DropTable) WithChildren ¶
WithChildren implements the Node interface.
func (*DropTable) WithDatabase ¶
WithDatabase implements the sql.Databaser interface.
type DropTrigger ¶
type DropTrigger struct { IfExists bool TriggerName string // contains filtered or unexported fields }
func NewDropTrigger ¶
func NewDropTrigger(db sql.Database, trigger string, ifExists bool) *DropTrigger
NewDropTrigger creates a new NewDropTrigger node for DROP TRIGGER statements.
func (*DropTrigger) Children ¶
func (d *DropTrigger) Children() []sql.Node
Children implements the sql.Node interface.
func (*DropTrigger) Database ¶
func (d *DropTrigger) Database() sql.Database
Database implements the sql.Databaser interface.
func (*DropTrigger) Resolved ¶
func (d *DropTrigger) Resolved() bool
Resolved implements the sql.Node interface.
func (*DropTrigger) Schema ¶
func (d *DropTrigger) Schema() sql.Schema
Schema implements the sql.Node interface.
func (*DropTrigger) String ¶
func (d *DropTrigger) String() string
String implements the sql.Node interface.
func (*DropTrigger) WithChildren ¶
WithChildren implements the sql.Node interface.
func (*DropTrigger) WithDatabase ¶
WithDatabase implements the sql.Databaser interface.
type DropView ¶
DropView is a node representing the removal of a list of views, defined by the children member. The flag ifExists represents whether the user wants the node to fail if any of the views in children does not exist.
func NewDropView ¶
NewDropView creates a DropView node with the specified parameters, setting its catalog to nil.
func (*DropView) Children ¶
Children implements the Node interface. It returns the children of the CreateView node; i.e., all the views that will be dropped.
func (*DropView) Resolved ¶
Resolved implements the Node interface. This node is resolved if and only if all of its children are resolved.
func (*DropView) RowIter ¶
RowIter implements the Node interface. When executed, this function drops all the views defined by the node's children. It errors if the flag ifExists is set to false and there is some view that does not exist.
type DummyResolvedDB ¶
type DummyResolvedDB struct {
// contains filtered or unexported fields
}
DummyResolvedDB is a transient database useful only for instances where a database is not available but required. No tables are persisted, nor will be returned.
func NewDummyResolvedDB ¶
func NewDummyResolvedDB(name string) *DummyResolvedDB
NewDummyResolvedDB creates a new dummy database with the given name.
func (*DummyResolvedDB) CreateTable ¶
func (*DummyResolvedDB) DropTable ¶
func (d *DummyResolvedDB) DropTable(ctx *sql.Context, name string) error
func (*DummyResolvedDB) GetTableInsensitive ¶
func (*DummyResolvedDB) GetTableNames ¶
func (d *DummyResolvedDB) GetTableNames(ctx *sql.Context) ([]string, error)
func (*DummyResolvedDB) Name ¶
func (d *DummyResolvedDB) Name() string
func (*DummyResolvedDB) RenameTable ¶
func (d *DummyResolvedDB) RenameTable(ctx *sql.Context, oldName, newName string) error
type EvalPartitionKeyValueIter ¶
type EvalPartitionKeyValueIter struct {
// contains filtered or unexported fields
}
func NewEvalPartitionKeyValueIter ¶
func NewEvalPartitionKeyValueIter(ctx *sql.Context, iter sql.PartitionIndexKeyValueIter, columns []string, exprs []sql.Expression) *EvalPartitionKeyValueIter
func (*EvalPartitionKeyValueIter) Close ¶
func (i *EvalPartitionKeyValueIter) Close() error
func (*EvalPartitionKeyValueIter) Next ¶
func (i *EvalPartitionKeyValueIter) Next() (sql.Partition, sql.IndexKeyValueIter, error)
type Exchange ¶
Exchange is a node that can parallelize the underlying tree iterating partitions concurrently.
func NewExchange ¶
NewExchange creates a new Exchange node.
func (*Exchange) DebugString ¶
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) DebugString ¶
func (*Filter) Expressions ¶
func (f *Filter) Expressions() []sql.Expression
Expressions implements the Expressioner interface.
func (*Filter) WithChildren ¶
WithChildren implements the Node interface.
func (*Filter) WithExpressions ¶
WithExpressions implements the Expressioner 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 Generate ¶
type Generate struct { UnaryNode Column *expression.GetField }
Generate will explode rows using a generator.
func NewGenerate ¶
func NewGenerate(child sql.Node, col *expression.GetField) *Generate
NewGenerate creates a new generate node.
func (*Generate) Expressions ¶
func (g *Generate) Expressions() []sql.Expression
Expressions implements the Expressioner interface.
func (*Generate) WithChildren ¶
WithChildren implements the Node interface.
func (*Generate) WithExpressions ¶
WithExpressions implements the Expressioner interface.
type GroupBy ¶
type GroupBy struct { UnaryNode SelectedExprs []sql.Expression GroupByExprs []sql.Expression }
GroupBy groups the rows by some expressions.
func NewGroupBy ¶
func NewGroupBy(selectedExprs, groupByExprs []sql.Expression, child sql.Node) *GroupBy
NewGroupBy creates a new GroupBy node. Like Project, GroupBy is a top-level node, and contains all the fields that will appear in the output of the query. Some of these fields may be aggregate functions, some may be columns or other expressions. Unlike a project, the GroupBy also has a list of group-by expressions, which usually also appear in the list of selected expressions.
func (*GroupBy) DebugString ¶
func (*GroupBy) Expressions ¶
func (g *GroupBy) Expressions() []sql.Expression
Expressions implements the Expressioner interface.
func (*GroupBy) WithChildren ¶
WithChildren implements the Node interface.
func (*GroupBy) WithExpressions ¶
WithExpressions implements the Node interface.
type Having ¶
type Having struct { UnaryNode Cond sql.Expression }
Having node is a filter that supports aggregate expressions. A having node is identical to a filter node in behaviour. The difference is that some analyzer rules work specifically on having clauses and not filters. For that reason, Having is a completely new node instead of using just filter.
func NewHaving ¶
func NewHaving(cond sql.Expression, child sql.Node) *Having
NewHaving creates a new having node.
func (*Having) Expressions ¶
func (h *Having) Expressions() []sql.Expression
Expressions implements the sql.Expressioner interface.
func (*Having) WithChildren ¶
WithChildren implements the Node interface.
func (*Having) WithExpressions ¶
WithExpressions implements the Expressioner interface.
type InSubquery ¶
type InSubquery struct {
expression.BinaryExpression
}
InSubquery is an expression that checks an expression is in the result of a subquery. It's in the plan package, instead of the expression package, because Subquery is itself in the plan package (because it functions more like a plan node than an expression in its evaluation).
func NewInSubquery ¶
func NewInSubquery(left sql.Expression, right sql.Expression) *InSubquery
NewInSubquery creates an InSubquery expression.
func (*InSubquery) Children ¶
func (in *InSubquery) Children() []sql.Expression
Children implements the Expression interface.
func (*InSubquery) DebugString ¶
func (in *InSubquery) DebugString() string
func (*InSubquery) String ¶
func (in *InSubquery) String() string
func (*InSubquery) WithChildren ¶
func (in *InSubquery) WithChildren(children ...sql.Expression) (sql.Expression, error)
WithChildren implements the Expression interface.
type IndexAction ¶
type IndexAction byte
const ( IndexAction_Create IndexAction = iota IndexAction_Drop IndexAction_Rename )
type IndexDefinition ¶
type IndexDefinition struct { IndexName string Using sql.IndexUsing Constraint sql.IndexConstraint Columns []sql.IndexColumn Comment string }
type IndexedJoin ¶
type IndexedJoin struct { // The primary and secondary table nodes. The normal meanings of Left and // Right in BinaryNode aren't necessarily meaningful here -- the Left node is always the primary table, and the Right // node is always the secondary. These may or may not correspond to the left and right tables in the written query. BinaryNode // The join condition. Cond sql.Expression // contains filtered or unexported fields }
An IndexedJoin is a join that uses index lookups for the secondary table.
func NewIndexedJoin ¶
func NewIndexedJoin(left, right sql.Node, joinType JoinType, cond sql.Expression) *IndexedJoin
func (*IndexedJoin) DebugString ¶
func (ij *IndexedJoin) DebugString() string
func (*IndexedJoin) JoinType ¶
func (ij *IndexedJoin) JoinType() JoinType
JoinType returns the join type for this indexed join
func (*IndexedJoin) Schema ¶
func (ij *IndexedJoin) Schema() sql.Schema
func (*IndexedJoin) String ¶
func (ij *IndexedJoin) String() string
func (*IndexedJoin) WithChildren ¶
type IndexedTableAccess ¶
type IndexedTableAccess struct { *ResolvedTable // contains filtered or unexported fields }
IndexedTableAccess represents an indexed lookup of a particular ResolvedTable. The values for the key used to access the indexed table is provided in RowIter(), or during static analysis.
func NewIndexedTableAccess ¶
func NewIndexedTableAccess(resolvedTable *ResolvedTable, index sql.Index, keyExprs []sql.Expression) *IndexedTableAccess
NewIndexedTableAccess returns a new IndexedTableAccess node with the index and key expressions given. An index lookup will be calculated and applied for the row given in RowIter().
func NewStaticIndexedTableAccess ¶
func NewStaticIndexedTableAccess(resolvedTable *ResolvedTable, lookup sql.IndexLookup, index sql.Index, keyExprs []sql.Expression) *IndexedTableAccess
NewStaticIndexedTableAccess returns a new IndexedTableAccess node with the indexlookup given. It will be applied in RowIter() without consideration of the row given. The key expression should faithfully represent this lookup, but is only for display purposes.
func (*IndexedTableAccess) DebugString ¶
func (i *IndexedTableAccess) DebugString() string
func (*IndexedTableAccess) Expressions ¶
func (i *IndexedTableAccess) Expressions() []sql.Expression
Expressions implements sql.Expressioner
func (*IndexedTableAccess) String ¶
func (i *IndexedTableAccess) String() string
func (*IndexedTableAccess) WithChildren ¶
func (*IndexedTableAccess) WithExpressions ¶
func (i *IndexedTableAccess) WithExpressions(exprs ...sql.Expression) (sql.Node, error)
WithExpressions implements sql.Expressioner
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) DebugString ¶
func (*InnerJoin) Expressions ¶
func (j *InnerJoin) Expressions() []sql.Expression
Expressions implements the Expressioner interface.
func (*InnerJoin) JoinCond ¶
func (j *InnerJoin) JoinCond() sql.Expression
func (*InnerJoin) WithChildren ¶
WithChildren implements the Node interface.
func (*InnerJoin) WithExpressions ¶
WithExpressions implements the Expressioner interface.
type InsertInto ¶
type InsertInto struct { BinaryNode ColumnNames []string IsReplace bool OnDupExprs []sql.Expression }
InsertInto is a node describing the insertion into some table.
func NewInsertInto ¶
func NewInsertInto(dst, src sql.Node, isReplace bool, cols []string, onDupExprs []sql.Expression) *InsertInto
NewInsertInto creates an InsertInto node.
func (InsertInto) DebugString ¶
func (p InsertInto) DebugString() string
func (*InsertInto) Expressions ¶
func (p *InsertInto) Expressions() []sql.Expression
func (*InsertInto) Resolved ¶
func (p *InsertInto) Resolved() bool
Resolved implements the Resolvable interface.
func (*InsertInto) Schema ¶
func (p *InsertInto) Schema() sql.Schema
Schema implements the sql.Node interface. Insert nodes return rows that are inserted. Replaces return a concatenation of the deleted row and the inserted row. If no row was deleted, the value of those columns is nil.
func (InsertInto) String ¶
func (p InsertInto) String() string
func (*InsertInto) WithChildren ¶
WithChildren implements the Node interface.
func (*InsertInto) WithExpressions ¶
func (p *InsertInto) WithExpressions(newExprs ...sql.Expression) (sql.Node, error)
type LeftJoin ¶
type LeftJoin struct { BinaryNode Cond sql.Expression }
LeftJoin is a left join between two tables.
func NewLeftJoin ¶
func NewLeftJoin(left, right sql.Node, cond sql.Expression) *LeftJoin
NewLeftJoin creates a new left join node from two tables.
func (*LeftJoin) DebugString ¶
func (*LeftJoin) Expressions ¶
func (j *LeftJoin) Expressions() []sql.Expression
Expressions implements the Expressioner interface.
func (*LeftJoin) JoinCond ¶
func (j *LeftJoin) JoinCond() sql.Expression
func (*LeftJoin) WithChildren ¶
WithChildren implements the Node interface.
func (*LeftJoin) WithExpressions ¶
WithExpressions implements the Expressioner interface.
type Limit ¶
Limit is a node that only allows up to N rows to be retrieved.
func (Limit) DebugString ¶
type LockTables ¶
LockTables will lock tables for the session in which it's executed.
func NewLockTables ¶
func NewLockTables(locks []*TableLock) *LockTables
NewLockTables creates a new LockTables node.
func (*LockTables) Children ¶
func (t *LockTables) Children() []sql.Node
Children implements the sql.Node interface.
func (*LockTables) Resolved ¶
func (t *LockTables) Resolved() bool
Resolved implements the sql.Node interface.
func (*LockTables) Schema ¶
func (t *LockTables) Schema() sql.Schema
Schema implements the sql.Node interface.
func (*LockTables) String ¶
func (t *LockTables) String() string
func (*LockTables) WithChildren ¶
WithChildren implements the Node interface.
type ModifyColumn ¶
type ModifyColumn struct {
// contains filtered or unexported fields
}
func NewModifyColumn ¶
func NewModifyColumn(db sql.Database, tableName string, columnName string, column *sql.Column, order *sql.ColumnOrder) *ModifyColumn
func (*ModifyColumn) Column ¶
func (m *ModifyColumn) Column() *sql.Column
func (*ModifyColumn) Expressions ¶
func (m *ModifyColumn) Expressions() []sql.Expression
func (*ModifyColumn) Order ¶
func (m *ModifyColumn) Order() *sql.ColumnOrder
func (*ModifyColumn) Resolved ¶
func (m *ModifyColumn) Resolved() bool
Resolved implements the Resolvable interface.
func (*ModifyColumn) Schema ¶
func (m *ModifyColumn) Schema() sql.Schema
Schema implements the sql.Node interface.
func (*ModifyColumn) String ¶
func (m *ModifyColumn) String() string
func (*ModifyColumn) TableName ¶
func (m *ModifyColumn) TableName() string
func (*ModifyColumn) WithChildren ¶
func (*ModifyColumn) WithDatabase ¶
func (*ModifyColumn) WithExpressions ¶
func (m *ModifyColumn) WithExpressions(exprs ...sql.Expression) (sql.Node, error)
type NamedNotifyFunc ¶
type NamedNotifyFunc func(name string)
NamedNotifyFunc is a function to notify about some event with a string argument.
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) WithChildren ¶
WithChildren 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 ¶
Offset is a node that skips the first N rows.
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 memory.
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) WithChildren ¶
WithChildren implements the Node interface.
type ProcessIndexableTable ¶
type ProcessIndexableTable struct { sql.DriverIndexableTable OnPartitionDone NamedNotifyFunc OnPartitionStart NamedNotifyFunc OnRowNext NamedNotifyFunc }
ProcessIndexableTable is a wrapper for sql.Tables inside a query process that support indexing. It notifies the process manager about the status of a query when a partition is processed.
func NewProcessIndexableTable ¶
func NewProcessIndexableTable(t sql.DriverIndexableTable, onPartitionDone, onPartitionStart, OnRowNext NamedNotifyFunc) *ProcessIndexableTable
NewProcessIndexableTable returns a new ProcessIndexableTable.
func (*ProcessIndexableTable) IndexKeyValues ¶
func (t *ProcessIndexableTable) IndexKeyValues( ctx *sql.Context, columns []string, ) (sql.PartitionIndexKeyValueIter, error)
IndexKeyValues implements the sql.IndexableTable interface.
func (*ProcessIndexableTable) PartitionRows ¶
func (t *ProcessIndexableTable) PartitionRows(ctx *sql.Context, p sql.Partition) (sql.RowIter, error)
PartitionRows implements the sql.Table interface.
func (*ProcessIndexableTable) Underlying ¶
func (t *ProcessIndexableTable) Underlying() sql.Table
Underlying implements sql.TableWrapper interface.
type ProcessTable ¶
type ProcessTable struct { sql.Table OnPartitionDone NamedNotifyFunc OnPartitionStart NamedNotifyFunc OnRowNext NamedNotifyFunc }
ProcessTable is a wrapper for sql.Tables inside a query process. It notifies the process manager about the status of a query when a partition is processed.
func NewProcessTable ¶
func NewProcessTable(t sql.Table, onPartitionDone, onPartitionStart, OnRowNext NamedNotifyFunc) *ProcessTable
NewProcessTable returns a new ProcessTable.
func (*ProcessTable) PartitionRows ¶
PartitionRows implements the sql.Table interface.
func (*ProcessTable) Underlying ¶
func (t *ProcessTable) Underlying() sql.Table
Underlying implements sql.TableWrapper 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) DebugString ¶
func (*Project) Expressions ¶
func (p *Project) Expressions() []sql.Expression
Expressions implements the Expressioner interface.
func (*Project) WithChildren ¶
WithChildren implements the Node interface.
func (*Project) WithExpressions ¶
WithExpressions implements the Expressioner interface.
type QueryProcess ¶
type QueryProcess struct { UnaryNode Notify NotifyFunc }
QueryProcess represents a running query process node. It will use a callback to notify when it has finished running.
func NewQueryProcess ¶
func NewQueryProcess(node sql.Node, notify NotifyFunc) *QueryProcess
NewQueryProcess creates a new QueryProcess node.
func (*QueryProcess) DebugString ¶
func (p *QueryProcess) DebugString() string
func (*QueryProcess) String ¶
func (p *QueryProcess) String() string
func (*QueryProcess) WithChildren ¶
WithChildren implements the Node interface.
type RenameColumn ¶
type RenameColumn struct {
// contains filtered or unexported fields
}
func NewRenameColumn ¶
func (*RenameColumn) Resolved ¶
func (c *RenameColumn) Resolved() bool
Resolved implements the Resolvable interface.
func (*RenameColumn) String ¶
func (r *RenameColumn) String() string
func (*RenameColumn) WithChildren ¶
func (*RenameColumn) WithDatabase ¶
type RenameTable ¶
type RenameTable struct {
// contains filtered or unexported fields
}
func NewRenameTable ¶
func NewRenameTable(db sql.Database, oldNames, newNames []string) *RenameTable
Creates a new RenameTable node
func (*RenameTable) Resolved ¶
func (c *RenameTable) Resolved() bool
Resolved implements the Resolvable interface.
func (*RenameTable) String ¶
func (r *RenameTable) String() string
func (*RenameTable) WithChildren ¶
func (*RenameTable) WithDatabase ¶
type ResolvedTable ¶
ResolvedTable represents a resolved SQL Table.
func NewResolvedTable ¶
func NewResolvedTable(table sql.Table) *ResolvedTable
NewResolvedTable creates a new instance of ResolvedTable.
func (*ResolvedTable) Children ¶
func (*ResolvedTable) Children() []sql.Node
Children implements the Node interface.
func (*ResolvedTable) DebugString ¶
func (t *ResolvedTable) DebugString() string
func (*ResolvedTable) Resolved ¶
func (*ResolvedTable) Resolved() bool
Resolved implements the Resolvable interface.
func (*ResolvedTable) String ¶
func (t *ResolvedTable) String() string
func (*ResolvedTable) WithChildren ¶
WithChildren implements the Node interface.
type RightJoin ¶
type RightJoin struct { BinaryNode Cond sql.Expression }
RightJoin is a left join between two tables.
func NewRightJoin ¶
func NewRightJoin(left, right sql.Node, cond sql.Expression) *RightJoin
NewRightJoin creates a new right join node from two tables.
func (*RightJoin) DebugString ¶
func (*RightJoin) Expressions ¶
func (j *RightJoin) Expressions() []sql.Expression
Expressions implements the Expressioner interface.
func (*RightJoin) JoinCond ¶
func (j *RightJoin) JoinCond() sql.Expression
func (*RightJoin) WithChildren ¶
WithChildren implements the Node interface.
func (*RightJoin) WithExpressions ¶
WithExpressions implements the Expressioner interface.
type Rollback ¶
type Rollback struct{}
Rollback undoes the changes performed in a transaction. This is provided just for compatibility with SQL clients and is a no-op.
type RowUpdateAccumulator ¶
type RowUpdateAccumulator struct { UnaryNode RowUpdateType }
RowUpdateAccumulator wraps other nodes that update tables, and returns their results as OKResults with the appropriate fields set.
func NewRowUpdateAccumulator ¶
func NewRowUpdateAccumulator(n sql.Node, updateType RowUpdateType) *RowUpdateAccumulator
NewRowUpdateResult returns a new RowUpdateResult with the given node to wrap.
func (RowUpdateAccumulator) DebugString ¶
func (r RowUpdateAccumulator) DebugString() string
func (RowUpdateAccumulator) Schema ¶
func (r RowUpdateAccumulator) Schema() sql.Schema
func (RowUpdateAccumulator) String ¶
func (r RowUpdateAccumulator) String() string
func (RowUpdateAccumulator) WithChildren ¶
type RowUpdateType ¶
type RowUpdateType int
const ( UpdateTypeInsert RowUpdateType = iota UpdateTypeReplace UpdateTypeDuplicateKeyUpdate UpdateTypeUpdate UpdateTypeDelete )
type Set ¶
type Set struct {
Exprs []sql.Expression
}
Set represents a set statement. This can be variables, but in some instances can also refer to row values.
func (*Set) DebugString ¶
func (*Set) Expressions ¶
func (s *Set) Expressions() []sql.Expression
Expressions implements the sql.Expressioner interface.
func (*Set) WithChildren ¶
WithChildren implements the sql.Node interface.
func (*Set) WithExpressions ¶
WithExpressions implements the sql.Expressioner interface.
type ShowColumns ¶
ShowColumns shows the columns details of a table.
func NewShowColumns ¶
func NewShowColumns(full bool, child sql.Node) *ShowColumns
NewShowColumns creates a new ShowColumns node.
func (*ShowColumns) Schema ¶
func (s *ShowColumns) Schema() sql.Schema
Schema implements the sql.Node interface.
func (*ShowColumns) String ¶
func (s *ShowColumns) String() string
func (*ShowColumns) WithChildren ¶
WithChildren implements the Node interface.
type ShowCreateDatabase ¶
type ShowCreateDatabase struct { IfNotExists bool // contains filtered or unexported fields }
ShowCreateDatabase returns the SQL for creating a database.
func NewShowCreateDatabase ¶
func NewShowCreateDatabase(db sql.Database, ifNotExists bool) *ShowCreateDatabase
NewShowCreateDatabase creates a new ShowCreateDatabase node.
func (*ShowCreateDatabase) Children ¶
func (s *ShowCreateDatabase) Children() []sql.Node
Children implements the sql.Node interface.
func (*ShowCreateDatabase) Database ¶
func (s *ShowCreateDatabase) Database() sql.Database
Database implements the sql.Databaser interface.
func (*ShowCreateDatabase) Resolved ¶
func (s *ShowCreateDatabase) Resolved() bool
Resolved implements the sql.Node interface.
func (*ShowCreateDatabase) Schema ¶
func (s *ShowCreateDatabase) Schema() sql.Schema
Schema implements the sql.Node interface.
func (*ShowCreateDatabase) String ¶
func (s *ShowCreateDatabase) String() string
func (*ShowCreateDatabase) WithChildren ¶
WithChildren implements the Node interface.
func (*ShowCreateDatabase) WithDatabase ¶
WithDatabase implements the sql.Databaser interface.
type ShowCreateTable ¶
ShowCreateTable is a node that shows the CREATE TABLE statement for a table.
func (*ShowCreateTable) Resolved ¶
func (n *ShowCreateTable) Resolved() bool
Resolved implements the Resolvable interface.
func (*ShowCreateTable) Schema ¶
func (n *ShowCreateTable) Schema() sql.Schema
Schema implements the Node interface.
func (*ShowCreateTable) String ¶
func (n *ShowCreateTable) String() string
String implements the fmt.Stringer interface.
func (*ShowCreateTable) WithChildren ¶
type ShowCreateTrigger ¶
type ShowCreateTrigger struct { TriggerName string // contains filtered or unexported fields }
func NewShowCreateTrigger ¶
func NewShowCreateTrigger(db sql.Database, trigger string) *ShowCreateTrigger
NewShowCreateTrigger creates a new ShowCreateTrigger node for SHOW CREATE TRIGGER statements.
func (*ShowCreateTrigger) Children ¶
func (s *ShowCreateTrigger) Children() []sql.Node
Children implements the sql.Node interface.
func (*ShowCreateTrigger) Database ¶
func (s *ShowCreateTrigger) Database() sql.Database
Database implements the sql.Databaser interface.
func (*ShowCreateTrigger) Resolved ¶
func (s *ShowCreateTrigger) Resolved() bool
Resolved implements the sql.Node interface.
func (*ShowCreateTrigger) Schema ¶
func (s *ShowCreateTrigger) Schema() sql.Schema
Schema implements the sql.Node interface.
func (*ShowCreateTrigger) String ¶
func (s *ShowCreateTrigger) String() string
String implements the sql.Node interface.
func (*ShowCreateTrigger) WithChildren ¶
WithChildren implements the sql.Node interface.
func (*ShowCreateTrigger) WithDatabase ¶
WithDatabase implements the sql.Databaser interface.
type ShowDatabases ¶
ShowDatabases is a node that shows the databases.
func NewShowDatabases ¶
func NewShowDatabases() *ShowDatabases
NewShowDatabases creates a new show databases node.
func (*ShowDatabases) Children ¶
func (*ShowDatabases) Children() []sql.Node
Children implements the Node interface.
func (*ShowDatabases) Resolved ¶
func (p *ShowDatabases) Resolved() bool
Resolved implements the Resolvable interface.
func (*ShowDatabases) Schema ¶
func (*ShowDatabases) Schema() sql.Schema
Schema implements the Node interface.
func (ShowDatabases) String ¶
func (p ShowDatabases) String() string
func (*ShowDatabases) WithChildren ¶
WithChildren implements the Node interface.
type ShowIndexes ¶
ShowIndexes is a node that shows the indexes on a table.
func (*ShowIndexes) Schema ¶
func (n *ShowIndexes) Schema() sql.Schema
Schema implements the Node interface.
func (*ShowIndexes) String ¶
func (n *ShowIndexes) String() string
String implements the fmt.Stringer interface.
func (*ShowIndexes) WithChildren ¶
WithChildren implements the Node interface.
type ShowProcessList ¶
type ShowProcessList struct { Database string *sql.ProcessList }
ShowProcessList shows a list of all current running processes.
func NewShowProcessList ¶
func NewShowProcessList() *ShowProcessList
NewShowProcessList creates a new ProcessList node.
func (*ShowProcessList) Children ¶
func (p *ShowProcessList) Children() []sql.Node
Children implements the Node interface.
func (*ShowProcessList) Resolved ¶
func (p *ShowProcessList) Resolved() bool
Resolved implements the Node interface.
func (*ShowProcessList) Schema ¶
func (p *ShowProcessList) Schema() sql.Schema
Schema implements the Node interface.
func (*ShowProcessList) String ¶
func (p *ShowProcessList) String() string
func (*ShowProcessList) WithChildren ¶
WithChildren implements the Node interface.
type ShowTableStatus ¶
ShowTableStatus returns the status of the tables in the databases.
func NewShowTableStatus ¶
func NewShowTableStatus(dbs ...string) *ShowTableStatus
NewShowTableStatus creates a new ShowTableStatus node.
func (*ShowTableStatus) Children ¶
func (s *ShowTableStatus) Children() []sql.Node
Children implements the sql.Node interface.
func (*ShowTableStatus) Resolved ¶
func (s *ShowTableStatus) Resolved() bool
Resolved implements the sql.Node interface.
func (*ShowTableStatus) Schema ¶
func (s *ShowTableStatus) Schema() sql.Schema
Schema implements the sql.Node interface.
func (*ShowTableStatus) String ¶
func (s *ShowTableStatus) String() string
func (*ShowTableStatus) WithChildren ¶
WithChildren implements the Node interface.
type ShowTables ¶
type ShowTables struct { Full bool AsOf sql.Expression // contains filtered or unexported fields }
ShowTables is a node that shows the database tables.
func NewShowTables ¶
func NewShowTables(database sql.Database, full bool, asOf sql.Expression) *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) Database ¶
func (p *ShowTables) Database() sql.Database
Database implements the sql.Databaser interface.
func (*ShowTables) Expressions ¶
func (p *ShowTables) Expressions() []sql.Expression
Expressions implements sql.Expressioner
func (*ShowTables) Resolved ¶
func (p *ShowTables) Resolved() bool
Resolved implements the Resolvable interface.
func (*ShowTables) Schema ¶
func (p *ShowTables) Schema() sql.Schema
Schema implements the Node interface.
func (ShowTables) String ¶
func (p ShowTables) String() string
func (*ShowTables) WithChildren ¶
WithChildren implements the Node interface.
func (*ShowTables) WithDatabase ¶
WithDatabase implements the sql.Databaser interface.
func (*ShowTables) WithExpressions ¶
func (p *ShowTables) WithExpressions(exprs ...sql.Expression) (sql.Node, error)
WithExpressions implements sql.Expressioner
type ShowTriggers ¶
type ShowTriggers struct { Triggers []*CreateTrigger // contains filtered or unexported fields }
func NewShowTriggers ¶
func NewShowTriggers(db sql.Database) *ShowTriggers
NewShowCreateTrigger creates a new ShowCreateTrigger node for SHOW TRIGGER statements.
func (*ShowTriggers) Children ¶
func (s *ShowTriggers) Children() []sql.Node
Children implements the sql.Node interface.
func (*ShowTriggers) Database ¶
func (s *ShowTriggers) Database() sql.Database
Database implements the sql.Databaser interface.
func (*ShowTriggers) Resolved ¶
func (s *ShowTriggers) Resolved() bool
Resolved implements the sql.Node interface.
func (*ShowTriggers) Schema ¶
func (s *ShowTriggers) Schema() sql.Schema
Schema implements the sql.Node interface.
func (*ShowTriggers) String ¶
func (s *ShowTriggers) String() string
String implements the sql.Node interface.
func (*ShowTriggers) WithChildren ¶
WithChildren implements the sql.Node interface.
func (*ShowTriggers) WithDatabase ¶
WithDatabase implements the sql.Databaser interface.
type ShowVariables ¶
type ShowVariables struct {
// contains filtered or unexported fields
}
ShowVariables is a node that shows the global and session variables
func NewShowVariables ¶
func NewShowVariables(config map[string]sql.TypedValue, like string) *ShowVariables
NewShowVariables returns a new ShowVariables reference. config is a variables lookup table like is a "like pattern". If like is an empty string it will return all variables.
func (*ShowVariables) Children ¶
func (*ShowVariables) Children() []sql.Node
Children implements sql.Node interface. The function always returns nil.
func (*ShowVariables) Resolved ¶
func (sv *ShowVariables) Resolved() bool
Resolved implements sql.Node interface. The function always returns true.
func (*ShowVariables) RowIter ¶
RowIter implements the sql.Node interface. The function returns an iterator for filtered variables (based on like pattern)
func (*ShowVariables) Schema ¶
func (*ShowVariables) Schema() sql.Schema
Schema returns a new Schema reference for "SHOW VARIABLES" query.
func (*ShowVariables) String ¶
func (sv *ShowVariables) String() string
String implements the fmt.Stringer interface.
func (*ShowVariables) WithChildren ¶
WithChildren implements the Node interface.
type ShowWarnings ¶
ShowWarnings is a node that shows the session warnings
func (ShowWarnings) Children ¶
func (ShowWarnings) Children() []sql.Node
Children implements sql.Node interface. The function always returns nil.
func (ShowWarnings) Resolved ¶
func (ShowWarnings) Resolved() bool
Resolved implements sql.Node interface. The function always returns true.
func (ShowWarnings) RowIter ¶
RowIter implements the sql.Node interface. The function returns an iterator for warnings (considering offset and counter)
func (ShowWarnings) Schema ¶
func (ShowWarnings) Schema() sql.Schema
Schema returns a new Schema reference for "SHOW VARIABLES" query.
func (ShowWarnings) String ¶
func (ShowWarnings) String() string
String implements the fmt.Stringer interface.
func (ShowWarnings) WithChildren ¶
WithChildren implements the Node interface.
type SingleDropView ¶
type SingleDropView struct {
// contains filtered or unexported fields
}
func NewSingleDropView ¶
func NewSingleDropView( database sql.Database, viewName string, ) *SingleDropView
NewSingleDropView creates a SingleDropView.
func (*SingleDropView) Children ¶
func (dv *SingleDropView) Children() []sql.Node
Children implements the Node interface. It always returns nil.
func (*SingleDropView) Database ¶
func (dv *SingleDropView) Database() sql.Database
Database implements the Databaser interfacee. It returns the node's database.
func (*SingleDropView) Resolved ¶
func (dv *SingleDropView) Resolved() bool
Resolved implements the Node interface. This node is resolved if and only if its database is resolved.
func (*SingleDropView) RowIter ¶
RowIter implements the Node interface. It always returns an empty iterator.
func (*SingleDropView) Schema ¶
func (dv *SingleDropView) Schema() sql.Schema
Schema implements the Node interface. It always returns nil.
func (*SingleDropView) String ¶
func (dv *SingleDropView) String() string
String implements the fmt.Stringer interface, using sql.TreePrinter to generate the string.
func (*SingleDropView) WithChildren ¶
WithChildren implements the Node interface. It only succeeds if the length of the specified children equals 0.
func (*SingleDropView) WithDatabase ¶
Database implements the Databaser interface, and it returns a copy of this node with the specified database.
type Sort ¶
Sort is the sort node.
func (*Sort) DebugString ¶
func (*Sort) Expressions ¶
func (s *Sort) Expressions() []sql.Expression
Expressions implements the Expressioner interface.
func (*Sort) WithChildren ¶
WithChildren implements the Node interface.
func (*Sort) WithExpressions ¶
WithExpressions implements the Expressioner 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.
func (SortField) DebugString ¶
type SortOrder ¶
type SortOrder byte
SortOrder represents the order of the sort (ascending or descending).
type Subquery ¶
type Subquery struct { // The subquery to execute for each row in the outer result set Query sql.Node // The original verbatim select statement for this subquery QueryString string // contains filtered or unexported fields }
Subquery is as an expression whose value is derived by executing a subquery. It must be executed for every row in the outer result set. It's in the plan package instead of the expression package because it functions more like a plan Node than an expression.
func NewSubquery ¶
NewSubquery returns a new subquery expression.
func (*Subquery) Children ¶
func (s *Subquery) Children() []sql.Expression
Children implements the Expression interface.
func (*Subquery) DebugString ¶
func (*Subquery) EvalMultiple ¶
EvalMultiple returns all rows returned by a subquery.
func (*Subquery) HashMultiple ¶
HashMultiple returns all rows returned by a subquery, backed by a sql.KeyValueCache. Keys are constructed using the 64-bit hash of the values stored.
func (*Subquery) IsNonDeterministic ¶
func (*Subquery) IsNullable ¶
IsNullable implements the Expression interface.
func (*Subquery) WithCachedResults ¶
WithCachedResults returns the subquery with CanCacheResults set to true.
func (*Subquery) WithChildren ¶
func (s *Subquery) WithChildren(children ...sql.Expression) (sql.Expression, error)
WithChildren implements the Expression interface.
type SubqueryAlias ¶
type SubqueryAlias struct { UnaryNode TextDefinition string // contains filtered or unexported fields }
SubqueryAlias is a node that gives a subquery a name.
func NewSubqueryAlias ¶
func NewSubqueryAlias(name, textDefinition string, node sql.Node) *SubqueryAlias
NewSubqueryAlias creates a new SubqueryAlias node.
func (*SubqueryAlias) AsView ¶
func (n *SubqueryAlias) AsView() sql.View
Returns the view wrapper for this subquery
func (SubqueryAlias) DebugString ¶
func (n SubqueryAlias) DebugString() string
func (*SubqueryAlias) Name ¶
func (n *SubqueryAlias) Name() string
Name implements the Table interface.
func (*SubqueryAlias) Opaque ¶
func (n *SubqueryAlias) Opaque() bool
Opaque implements the OpaqueNode 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) WithChildren ¶
WithChildren 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) DebugString ¶
func (t TableAlias) DebugString() string
func (*TableAlias) Name ¶
func (t *TableAlias) Name() string
Name implements the Nameable interface.
func (*TableAlias) Schema ¶
func (t *TableAlias) Schema() sql.Schema
Schema implements the Node interface. TableAlias alters the schema of its child element to rename the source of columns to the alias.
func (TableAlias) String ¶
func (t TableAlias) String() string
func (*TableAlias) WithChildren ¶
WithChildren implements the Node interface.
type TransformNodeWithParentFunc ¶
TransformNodeWithParentFunc is an analog to sql.TransformNodeFunc that also includes the parent of the node being transformed. The parent is for inspection only, and cannot be altered.
type TriggerEvent ¶
type TriggerEvent string
type TriggerExecutor ¶
type TriggerExecutor struct { BinaryNode // Left = wrapped node, Right = trigger execution logic TriggerEvent TriggerEvent TriggerTime TriggerTime TriggerDefinition sql.TriggerDefinition }
TriggerExecutor is node that wraps, or is wrapped by, an INSERT, UPDATE, or DELETE node to execute defined trigger logic either before or after that operation. When a table has multiple triggers defined, TriggerExecutor nodes can wrap each other as well.
func NewTriggerExecutor ¶
func NewTriggerExecutor(child, triggerLogic sql.Node, triggerEvent TriggerEvent, triggerTime TriggerTime, triggerDefinition sql.TriggerDefinition) *TriggerExecutor
func (*TriggerExecutor) DebugString ¶
func (t *TriggerExecutor) DebugString() string
func (*TriggerExecutor) Schema ¶
func (t *TriggerExecutor) Schema() sql.Schema
func (*TriggerExecutor) String ¶
func (t *TriggerExecutor) String() string
func (*TriggerExecutor) WithChildren ¶
type TriggerOrder ¶
type TriggerTime ¶
type TriggerTime string
const ( BeforeTrigger TriggerTime = "before" AfterTrigger = "after" )
type Truncate ¶
type Truncate struct { UnaryNode // contains filtered or unexported fields }
Truncate is a node describing the deletion of all rows from some table.
func NewTruncate ¶
NewTruncate creates a Truncate node.
func (*Truncate) DatabaseName ¶
DatabaseName returns the name of the database that this operation is being performed in.
func (Truncate) DebugString ¶
DebugString implements the DebugStringer interface.
type UnaryNode ¶
UnaryNode is a node that has only one child.
type Union ¶
type Union struct {
BinaryNode
}
Union is a node that returns everything in Left and then everything in Right
func (Union) DebugString ¶
func (*Union) Opaque ¶
Opaque implements the sql.OpaqueNode interface. Like SubqueryAlias, the selects in a Union must be evaluated in isolation.
type UnlockTables ¶
UnlockTables will release all locks for the current session.
func NewUnlockTables ¶
func NewUnlockTables() *UnlockTables
NewUnlockTables returns a new UnlockTables node.
func (*UnlockTables) Children ¶
func (t *UnlockTables) Children() []sql.Node
Children implements the sql.Node interface.
func (*UnlockTables) Resolved ¶
func (t *UnlockTables) Resolved() bool
Resolved implements the sql.Node interface.
func (*UnlockTables) Schema ¶
func (t *UnlockTables) Schema() sql.Schema
Schema implements the sql.Node interface.
func (*UnlockTables) String ¶
func (t *UnlockTables) String() string
func (*UnlockTables) WithChildren ¶
WithChildren implements the Node interface.
type UnresolvedTable ¶
type UnresolvedTable struct { Database string AsOf sql.Expression // contains filtered or unexported fields }
UnresolvedTable is a table that has not been resolved yet but whose name is known.
func NewUnresolvedTable ¶
func NewUnresolvedTable(name, db string) *UnresolvedTable
NewUnresolvedTable creates a new Unresolved table.
func NewUnresolvedTableAsOf ¶
func NewUnresolvedTableAsOf(name, db string, asOf sql.Expression) *UnresolvedTable
NewUnresolvedTableAsOf creates a new Unresolved table with an AS OF expression.
func (*UnresolvedTable) Children ¶
func (*UnresolvedTable) Children() []sql.Node
Children implements the Node interface.
func (*UnresolvedTable) Name ¶
func (t *UnresolvedTable) Name() string
Name implements the Nameable 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) WithAsOf ¶
func (t *UnresolvedTable) WithAsOf(asOf sql.Expression) (*UnresolvedTable, error)
WithAsOf returns a copy of this unresolved table with its AsOf field set to the given value. Analagous to WithChildren. This type is the only Node that can take an AS OF expression, so this isn't an interface.
func (*UnresolvedTable) WithChildren ¶
WithChildren implements the Node interface.
func (*UnresolvedTable) WithDatabase ¶
func (t *UnresolvedTable) WithDatabase(database string) (*UnresolvedTable, error)
WithDatabase returns a copy of this unresolved table with its Database field set to the given value. Analagous to WithChildren.
type Update ¶
type Update struct {
UnaryNode
}
Update is a node for updating rows on tables.
func NewUpdate ¶
func NewUpdate(n sql.Node, updateExprs []sql.Expression) *Update
NewUpdate creates an Update node.
func (*Update) DebugString ¶
type UpdateInfo ¶
type UpdateInfo struct {
Matched, Updated, Warnings int
}
UpdateInfo is the Info for OKResults returned by Update nodes.
type UpdateSource ¶
type UpdateSource struct { UnaryNode UpdateExprs []sql.Expression }
UpdateSource is the source of updates for an Update node. Its schema is the concatenation of the old and new rows, before and after being updated.
func NewUpdateSource ¶
func NewUpdateSource(node sql.Node, updateExprs []sql.Expression) *UpdateSource
NewUpdateSource returns a new UpdateSource from the node and expressions given.
func (*UpdateSource) DebugString ¶
func (u *UpdateSource) DebugString() string
func (*UpdateSource) Expressions ¶
func (u *UpdateSource) Expressions() []sql.Expression
Expressions implements the sql.Expressioner interface.
func (*UpdateSource) Resolved ¶
func (u *UpdateSource) Resolved() bool
Resolved implements the Resolvable interface.
func (*UpdateSource) Schema ¶
func (u *UpdateSource) Schema() sql.Schema
Schema implements sql.Node. The schema of an update is a concatenation of the old and new rows.
func (*UpdateSource) String ¶
func (u *UpdateSource) String() string
func (*UpdateSource) WithChildren ¶
func (*UpdateSource) WithExpressions ¶
func (u *UpdateSource) WithExpressions(newExprs ...sql.Expression) (sql.Node, error)
WithExpressions implements the sql.Expressioner interface.
type Use ¶
Use changes the current database.
func (*Use) WithChildren ¶
WithChildren implements the Node 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) DebugString ¶
func (*Values) Expressions ¶
func (p *Values) Expressions() []sql.Expression
Expressions implements the Expressioner interface.
func (*Values) WithChildren ¶
WithChildren implements the Node interface.
func (*Values) WithExpressions ¶
WithExpressions implements the Expressioner interface.
type Visitor ¶
type Visitor interface { // Visit method is invoked for each node encountered by Walk. // If the result Visitor is not nil, 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.
Source Files
¶
- alter_auto_increment.go
- alter_foreign_key.go
- alter_index.go
- begin_end_block.go
- bindvar.go
- common.go
- create_index.go
- create_view.go
- cross_join.go
- ddl.go
- ddl_trigger.go
- decorator.go
- delete.go
- describe.go
- distinct.go
- drop_index.go
- drop_trigger.go
- drop_view.go
- dummy_resolved_db.go
- empty_table.go
- exchange.go
- filter.go
- generate.go
- group_by.go
- having.go
- indexed_join.go
- indexed_table_access.go
- insert.go
- insubquery.go
- join.go
- limit.go
- lock.go
- naturaljoin.go
- nothing.go
- offset.go
- process.go
- processlist.go
- project.go
- resolved_table.go
- row_update_accumulator.go
- set.go
- show_create_database.go
- show_create_table.go
- show_create_trigger.go
- show_indexes.go
- show_tables.go
- show_triggers.go
- showcolumns.go
- showdatabases.go
- showtablestatus.go
- showvariables.go
- showwarnings.go
- sort.go
- subquery.go
- subqueryalias.go
- tablealias.go
- transaction.go
- transform.go
- trigger.go
- truncate.go
- union.go
- unresolved.go
- update.go
- update_source.go
- use.go
- values.go
- walk.go