Documentation ¶
Index ¶
- func BuildExpression(plan IPlan) (expressions.IExpression, error)
- func BuildExpressions(plan *MapPlan) ([]expressions.IExpression, error)
- func BuildVariableValues(plan IPlan) ([]string, error)
- func CheckAggregateExpressions(plan IPlan) (bool, error)
- func Walk(visit Visit, plans ...IPlan) error
- type AliasedExpressionPlan
- type BinaryExpressionPlan
- type ConstantPlan
- type CreateDatabasePlan
- type CreateTablePlan
- type DropDatabasePlan
- type DropTablePlan
- type FilterPlan
- type FunctionExpressionPlan
- type IPlan
- func NewCreateDatabasePlan(ast sqlparser.Statement) IPlan
- func NewCreateTablePlan(ast sqlparser.Statement) IPlan
- func NewDropDatabasePlan(ast sqlparser.Statement) IPlan
- func NewDropTablePlan(ast sqlparser.Statement) IPlan
- func NewInsertPlan(ast sqlparser.Statement) IPlan
- func NewSelectPlan(ast sqlparser.Statement) IPlan
- func NewShowDatabasesPlan(ast sqlparser.Statement) IPlan
- func NewShowTablesPlan(ast sqlparser.Statement) IPlan
- func NewUsePlan(ast sqlparser.Statement) IPlan
- func PlanFactory(query string) (IPlan, error)
- type InsertPlan
- type LimitPlan
- type MapPlan
- type Operator
- type Order
- type OrderByPlan
- type ProjectionPlan
- type ScanPlan
- type SelectPlan
- type SelectionMode
- type SelectionPlan
- type ShowDatabasesPlan
- type ShowTablesPlan
- type SinkPlan
- type TableValuedFunctionExpressionPlan
- type TableValuedFunctionPlan
- type UnaryExpressionPlan
- type UsePlan
- type VariablePlan
- type Visit
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildExpression ¶
func BuildExpression(plan IPlan) (expressions.IExpression, error)
func BuildExpressions ¶
func BuildExpressions(plan *MapPlan) ([]expressions.IExpression, error)
func BuildVariableValues ¶
Types ¶
type AliasedExpressionPlan ¶
func NewAliasedExpressionPlan ¶
func NewAliasedExpressionPlan(as string, expr IPlan) *AliasedExpressionPlan
func (*AliasedExpressionPlan) Build ¶
func (plan *AliasedExpressionPlan) Build() error
func (*AliasedExpressionPlan) String ¶
func (plan *AliasedExpressionPlan) String() string
func (*AliasedExpressionPlan) Walk ¶
func (plan *AliasedExpressionPlan) Walk(visit Visit) error
type BinaryExpressionPlan ¶
type BinaryExpressionPlan struct { Name string // 这里认为是函数才会有二元操作,所以需要一个函数的名字 FuncName string // 第一个操作单元 Left IPlan // Right IPlan }
用来组合两个Plan
func NewBinaryExpressionPlan ¶
func NewBinaryExpressionPlan(funcName string, left IPlan, right IPlan) *BinaryExpressionPlan
func (*BinaryExpressionPlan) Build ¶
func (plan *BinaryExpressionPlan) Build() error
func (*BinaryExpressionPlan) String ¶
func (plan *BinaryExpressionPlan) String() string
func (*BinaryExpressionPlan) Walk ¶
func (plan *BinaryExpressionPlan) Walk(visit Visit) error
type ConstantPlan ¶
type ConstantPlan struct { Name string // 要返回的值 Value interface{} }
返回固定的常量值
func NewConstantPlan ¶
func NewConstantPlan(value interface{}) *ConstantPlan
func (*ConstantPlan) Build ¶
func (plan *ConstantPlan) Build() error
func (*ConstantPlan) String ¶
func (plan *ConstantPlan) String() string
func (*ConstantPlan) Walk ¶
func (plan *ConstantPlan) Walk(visit Visit) error
type CreateDatabasePlan ¶
创建数据库的Plan
func (*CreateDatabasePlan) Build ¶
func (plan *CreateDatabasePlan) Build() error
func (*CreateDatabasePlan) Name ¶
func (plan *CreateDatabasePlan) Name() string
func (*CreateDatabasePlan) String ¶
func (plan *CreateDatabasePlan) String() string
func (*CreateDatabasePlan) Walk ¶
func (plan *CreateDatabasePlan) Walk(visit Visit) error
type CreateTablePlan ¶
func (*CreateTablePlan) Build ¶
func (plan *CreateTablePlan) Build() error
func (*CreateTablePlan) String ¶
func (plan *CreateTablePlan) String() string
func (*CreateTablePlan) Walk ¶
func (plan *CreateTablePlan) Walk(visit Visit) error
type DropDatabasePlan ¶
func (*DropDatabasePlan) Build ¶
func (plan *DropDatabasePlan) Build() error
func (*DropDatabasePlan) String ¶
func (plan *DropDatabasePlan) String() string
func (*DropDatabasePlan) Walk ¶
func (plan *DropDatabasePlan) Walk(visit Visit) error
type DropTablePlan ¶
func (*DropTablePlan) Build ¶
func (plan *DropTablePlan) Build() error
func (*DropTablePlan) String ¶
func (plan *DropTablePlan) String() string
func (*DropTablePlan) Walk ¶
func (plan *DropTablePlan) Walk(visit Visit) error
type FilterPlan ¶
func NewFilterPlan ¶
func NewFilterPlan(plan IPlan) *FilterPlan
func (*FilterPlan) Build ¶
func (plan *FilterPlan) Build() error
func (*FilterPlan) String ¶
func (plan *FilterPlan) String() string
func (*FilterPlan) Walk ¶
func (plan *FilterPlan) Walk(visit Visit) error
type FunctionExpressionPlan ¶
func NewFunctionExpressionPlan ¶
func NewFunctionExpressionPlan(funcName string, args ...IPlan) *FunctionExpressionPlan
func (*FunctionExpressionPlan) Build ¶
func (plan *FunctionExpressionPlan) Build() error
func (*FunctionExpressionPlan) String ¶
func (plan *FunctionExpressionPlan) String() string
func (*FunctionExpressionPlan) Walk ¶
func (plan *FunctionExpressionPlan) Walk(visit Visit) error
type IPlan ¶
func NewCreateDatabasePlan ¶
func NewCreateTablePlan ¶
func NewDropDatabasePlan ¶
func NewDropTablePlan ¶
func NewInsertPlan ¶
func NewSelectPlan ¶
func NewShowDatabasesPlan ¶
func NewShowTablesPlan ¶
func NewUsePlan ¶
func PlanFactory ¶
type InsertPlan ¶
func (*InsertPlan) Build ¶
func (plan *InsertPlan) Build() error
func (*InsertPlan) String ¶
func (plan *InsertPlan) String() string
func (*InsertPlan) Walk ¶
func (plan *InsertPlan) Walk(visit Visit) error
type LimitPlan ¶
func NewLimitPlan ¶
type Operator ¶
type Operator string
const ( OperatorEqual Operator = "=" OperatorNotEqual Operator = "!=" OperatorMoreThan Operator = ">" OperatorLessThan Operator = "<" OperatorLike Operator = "like" OperatorIn Operator = "in" OperatorNotIn Operator = "not in" OperatorGreaterEqual Operator = ">=" OperatorLessEqual Operator = "<=" OperatorMod Operator = "%" OperatorPlus Operator = "+" )
type OrderByPlan ¶
func NewOrderByPlan ¶
func NewOrderByPlan(orders ...Order) *OrderByPlan
func (*OrderByPlan) Build ¶
func (plan *OrderByPlan) Build() error
func (*OrderByPlan) String ¶
func (plan *OrderByPlan) String() string
func (*OrderByPlan) Walk ¶
func (plan *OrderByPlan) Walk(visit Visit) error
type ProjectionPlan ¶
func NewProjectPlan ¶
func NewProjectPlan(plan *MapPlan) *ProjectionPlan
func (*ProjectionPlan) Build ¶
func (plan *ProjectionPlan) Build() error
func (*ProjectionPlan) String ¶
func (plan *ProjectionPlan) String() string
func (*ProjectionPlan) Walk ¶
func (plan *ProjectionPlan) Walk(visit Visit) error
type ScanPlan ¶
type ScanPlan struct { Name string Table string Schema string Filter *FilterPlan `json:",omitempty"` Project *ProjectionPlan `json:",omitempty"` }
func NewScanPlan ¶
type SelectPlan ¶
type SelectPlan struct { Name string SubPlan *MapPlan `json:",omitempty"` // contains filtered or unexported fields }
func (*SelectPlan) Build ¶
func (plan *SelectPlan) Build() error
func (*SelectPlan) String ¶
func (plan *SelectPlan) String() string
func (*SelectPlan) Walk ¶
func (plan *SelectPlan) Walk(visit Visit) error
type SelectionMode ¶
type SelectionMode string
const ( NormalSelection SelectionMode = "NormalSelection" AggregateSelection SelectionMode = "AggregateSelection" GroupBySelection SelectionMode = "GroupBySelection" )
type SelectionPlan ¶
type SelectionPlan struct { Name string Projects *MapPlan `json:",omitempty"` GroupBys *MapPlan `json:",omitempty"` SelectionMode SelectionMode }
func NewSelectionPlan ¶
func NewSelectionPlan(projects *MapPlan, groupbys *MapPlan) *SelectionPlan
func (*SelectionPlan) Build ¶
func (plan *SelectionPlan) Build() error
func (*SelectionPlan) String ¶
func (plan *SelectionPlan) String() string
func (*SelectionPlan) Walk ¶
func (plan *SelectionPlan) Walk(visit Visit) error
type ShowDatabasesPlan ¶
func (*ShowDatabasesPlan) Build ¶
func (plan *ShowDatabasesPlan) Build() error
func (*ShowDatabasesPlan) String ¶
func (plan *ShowDatabasesPlan) String() string
func (*ShowDatabasesPlan) Walk ¶
func (plan *ShowDatabasesPlan) Walk(visit Visit) error
type ShowTablesPlan ¶
func (*ShowTablesPlan) Build ¶
func (plan *ShowTablesPlan) Build() error
func (*ShowTablesPlan) GetAst ¶
func (plan *ShowTablesPlan) GetAst() *sqlparser.Show
func (*ShowTablesPlan) String ¶
func (plan *ShowTablesPlan) String() string
func (*ShowTablesPlan) Walk ¶
func (plan *ShowTablesPlan) Walk(visit Visit) error
type SinkPlan ¶
type SinkPlan struct {
Name string
}
func NewSinkPlan ¶
func NewSinkPlan() *SinkPlan
type TableValuedFunctionExpressionPlan ¶
func NewTableValuedFunctionExpressionPlan ¶
func NewTableValuedFunctionExpressionPlan(name string, plan IPlan) *TableValuedFunctionExpressionPlan
func (*TableValuedFunctionExpressionPlan) Build ¶
func (plan *TableValuedFunctionExpressionPlan) Build() error
func (*TableValuedFunctionExpressionPlan) String ¶
func (plan *TableValuedFunctionExpressionPlan) String() string
func (*TableValuedFunctionExpressionPlan) Walk ¶
func (plan *TableValuedFunctionExpressionPlan) Walk(visit Visit) error
type TableValuedFunctionPlan ¶
func NewTableValuedFunctionPlan ¶
func NewTableValuedFunctionPlan(name string, plan *MapPlan) *TableValuedFunctionPlan
func (*TableValuedFunctionPlan) Build ¶
func (plan *TableValuedFunctionPlan) Build() error
func (*TableValuedFunctionPlan) String ¶
func (plan *TableValuedFunctionPlan) String() string
func (*TableValuedFunctionPlan) Walk ¶
func (plan *TableValuedFunctionPlan) Walk(visit Visit) error
type UnaryExpressionPlan ¶
func NewUnaryExpressionPlan ¶
func NewUnaryExpressionPlan(funcName string, expr IPlan) *UnaryExpressionPlan
func (*UnaryExpressionPlan) Build ¶
func (plan *UnaryExpressionPlan) Build() error
func (*UnaryExpressionPlan) String ¶
func (plan *UnaryExpressionPlan) String() string
func (*UnaryExpressionPlan) Walk ¶
func (plan *UnaryExpressionPlan) Walk(visit Visit) error
type VariablePlan ¶
func NewVariablePlan ¶
func NewVariablePlan(value string) *VariablePlan
func (*VariablePlan) Build ¶
func (plan *VariablePlan) Build() error
func (*VariablePlan) String ¶
func (plan *VariablePlan) String() string
func (*VariablePlan) Walk ¶
func (plan *VariablePlan) Walk(visit Visit) error
Source Files ¶
- parser.go
- planner.go
- planner_aliased_expression.go
- planner_binary_expression.go
- planner_constant.go
- planner_create_database.go
- planner_create_table.go
- planner_drop_database.go
- planner_drop_table.go
- planner_factory.go
- planner_filter.go
- planner_function_expression.go
- planner_insert.go
- planner_limit.go
- planner_map.go
- planner_operators.go
- planner_orderby.go
- planner_projection.go
- planner_scan.go
- planner_select.go
- planner_selection.go
- planner_show_databases.go
- planner_show_tables.go
- planner_sink.go
- planner_tvf.go
- planner_tvf_expression.go
- planner_unary_expression.go
- planner_use.go
- planner_variable.go
Click to show internal directories.
Click to hide internal directories.