Versions in this module Expand all Collapse all v0 v0.0.2 May 3, 2021 v0.0.1 May 3, 2021 Changes in this version + var ErrIntOverflowPlan = fmt.Errorf("proto: integer overflow") + var ErrInvalidLengthPlan = fmt.Errorf("proto: negative length found during unmarshaling") + var ErrNoDataSource = fmt.Errorf("QLBridge.plan: No datasource found") + var ErrNoPlan = fmt.Errorf("No Plan") + var ErrNotImplemented = fmt.Errorf("QLBridge.plan: not implemented") + func RewriteDescribeAsSelect(stmt *rel.SqlDescribe, ctx *Context) (*rel.SqlSelect, error) + func RewriteShowAsSelect(stmt *rel.SqlShow, ctx *Context) (*rel.SqlSelect, error) + type Alter struct + Ctx *Context + Stmt *rel.SqlAlter + func NewAlter(ctx *Context, stmt *rel.SqlAlter) *Alter + func (m *Alter) Walk(p Planner) error + type Command struct + Ctx *Context + Stmt *rel.SqlCommand + func (m *Command) Walk(p Planner) error + type Context struct + DisableRecover bool + Errors []error + Funcs expr.FuncResolver + Projection *Projection + Raw string + Schema *schema.Schema + SchemaName string + Session expr.ContextReadWriter + Stmt rel.SqlStatement + func NewContext(query string) *Context + func NewContextFromPb(pb *ContextPb) *Context + func (m *Context) Equal(c *Context) bool + func (m *Context) Recover() + func (m *Context) ToPB() *ContextPb + type ContextPb struct + Fingerprint uint64 + Id uint64 + Schema string + XXX_unrecognized []byte + func (*ContextPb) Descriptor() ([]byte, []int) + func (*ContextPb) ProtoMessage() + func (m *ContextPb) Marshal() (data []byte, err error) + func (m *ContextPb) MarshalTo(data []byte) (int, error) + func (m *ContextPb) Reset() + func (m *ContextPb) Size() (n int) + func (m *ContextPb) String() string + func (m *ContextPb) Unmarshal(data []byte) error + type Create struct + Ctx *Context + Stmt *rel.SqlCreate + func NewCreate(ctx *Context, stmt *rel.SqlCreate) *Create + func (m *Create) Walk(p Planner) error + type Delete struct + Source schema.ConnDeletion + Stmt *rel.SqlDelete + func (m *Delete) Walk(p Planner) error + type Drop struct + Ctx *Context + Stmt *rel.SqlDrop + func NewDrop(ctx *Context, stmt *rel.SqlDrop) *Drop + func (m *Drop) Walk(p Planner) error + type GroupBy struct + Partial bool + Stmt *rel.SqlSelect + func GroupByFromPB(pb *PlanPb) *GroupBy + func NewGroupBy(stmt *rel.SqlSelect) *GroupBy + func (m *GroupBy) Equal(t Task) bool + func (m *GroupBy) ToPb() (*PlanPb, error) + type GroupByPb struct + Select *rel.SqlSelectPb + XXX_unrecognized []byte + func (*GroupByPb) Descriptor() ([]byte, []int) + func (*GroupByPb) ProtoMessage() + func (m *GroupByPb) Marshal() (data []byte, err error) + func (m *GroupByPb) MarshalTo(data []byte) (int, error) + func (m *GroupByPb) Reset() + func (m *GroupByPb) Size() (n int) + func (m *GroupByPb) String() string + func (m *GroupByPb) Unmarshal(data []byte) error + type Having struct + Stmt *rel.SqlSelect + func HavingFromPB(pb *PlanPb) *Having + func NewHaving(stmt *rel.SqlSelect) *Having + func (m *Having) Equal(t Task) bool + func (m *Having) ToPb() (*PlanPb, error) + type HavingPb struct + Select *rel.SqlSelectPb + XXX_unrecognized []byte + func (*HavingPb) Descriptor() ([]byte, []int) + func (*HavingPb) ProtoMessage() + func (m *HavingPb) Marshal() (data []byte, err error) + func (m *HavingPb) MarshalTo(data []byte) (int, error) + func (m *HavingPb) Reset() + func (m *HavingPb) Size() (n int) + func (m *HavingPb) String() string + func (m *HavingPb) Unmarshal(data []byte) error + type Insert struct + Source schema.ConnUpsert + Stmt *rel.SqlInsert + func (m *Insert) Walk(p Planner) error + type Into struct + Stmt *rel.SqlInto + func (m *Into) Equal(t Task) bool + type JoinKey struct + Source *Source + func NewJoinKey(s *Source) *JoinKey + func (m *JoinKey) Equal(t Task) bool + type JoinKeyPb struct + Having *expr.NodePb + XXX_unrecognized []byte + func (*JoinKeyPb) Descriptor() ([]byte, []int) + func (*JoinKeyPb) ProtoMessage() + func (m *JoinKeyPb) Marshal() (data []byte, err error) + func (m *JoinKeyPb) MarshalTo(data []byte) (int, error) + func (m *JoinKeyPb) Reset() + func (m *JoinKeyPb) Size() (n int) + func (m *JoinKeyPb) String() string + func (m *JoinKeyPb) Unmarshal(data []byte) error + type JoinMerge struct + ColIndex map[string]int + Left Task + LeftFrom *rel.SqlSource + Right Task + RightFrom *rel.SqlSource + func NewJoinMerge(l, r Task, lf, rf *rel.SqlSource) *JoinMerge + func (m *JoinMerge) Equal(t Task) bool + type JoinMergePb struct + Having *expr.NodePb + XXX_unrecognized []byte + func (*JoinMergePb) Descriptor() ([]byte, []int) + func (*JoinMergePb) ProtoMessage() + func (m *JoinMergePb) Marshal() (data []byte, err error) + func (m *JoinMergePb) MarshalTo(data []byte) (int, error) + func (m *JoinMergePb) Reset() + func (m *JoinMergePb) Size() (n int) + func (m *JoinMergePb) String() string + func (m *JoinMergePb) Unmarshal(data []byte) error + type NextIdFunc func() uint64 + var NextId NextIdFunc + type Order struct + Stmt *rel.SqlSelect + func NewOrder(stmt *rel.SqlSelect) *Order + func OrderFromPB(pb *PlanPb) *Order + func (m *Order) Equal(t Task) bool + func (m *Order) ToPb() (*PlanPb, error) + type OrderPb struct + Select *rel.SqlSelectPb + XXX_unrecognized []byte + func (*OrderPb) Descriptor() ([]byte, []int) + func (*OrderPb) ProtoMessage() + func (m *OrderPb) Marshal() (data []byte, err error) + func (m *OrderPb) MarshalTo(data []byte) (int, error) + func (m *OrderPb) Reset() + func (m *OrderPb) Size() (n int) + func (m *OrderPb) String() string + func (m *OrderPb) Unmarshal(data []byte) error + type PlanBase struct + RootTask Task + func NewPlanBase(isParallel bool) *PlanBase + func (m *PlanBase) Add(task Task) error + func (m *PlanBase) Children() []Task + func (m *PlanBase) Close() error + func (m *PlanBase) Equal(t Task) bool + func (m *PlanBase) EqualBase(p *PlanBase) bool + func (m *PlanBase) IsParallel() bool + func (m *PlanBase) IsSequential() bool + func (m *PlanBase) Run() error + func (m *PlanBase) SetParallel() + func (m *PlanBase) SetSequential() + func (m *PlanBase) ToPb() (*PlanPb, error) + func (m *PlanBase) Walk(p Planner) error + type PlanPb struct + Children []*PlanPb + GroupBy *GroupByPb + Having *HavingPb + JoinKey *JoinKeyPb + JoinMerge *JoinMergePb + Order *OrderPb + Parallel bool + Projection *rel.ProjectionPb + Select *SelectPb + Source *SourcePb + Where *WherePb + XXX_unrecognized []byte + func (*PlanPb) Descriptor() ([]byte, []int) + func (*PlanPb) ProtoMessage() + func (m *PlanPb) Marshal() (data []byte, err error) + func (m *PlanPb) MarshalTo(data []byte) (int, error) + func (m *PlanPb) Reset() + func (m *PlanPb) Size() (n int) + func (m *PlanPb) String() string + func (m *PlanPb) Unmarshal(data []byte) error + type Planner interface + WalkAlter func(p *Alter) error + WalkCommand func(p *Command) error + WalkCreate func(p *Create) error + WalkDelete func(p *Delete) error + WalkDrop func(p *Drop) error + WalkInsert func(p *Insert) error + WalkInto func(p *Into) error + WalkPreparedStatement func(p *PreparedStatement) error + WalkProjectionFinal func(p *Select) error + WalkProjectionSource func(p *Source) error + WalkSelect func(p *Select) error + WalkSourceSelect func(p *Source) error + WalkUpdate func(p *Update) error + WalkUpsert func(p *Upsert) error + type PlannerDefault struct + Ctx *Context + Planner Planner + func NewPlanner(ctx *Context) *PlannerDefault + func (m *PlannerDefault) WalkAlter(p *Alter) error + func (m *PlannerDefault) WalkCommand(p *Command) error + func (m *PlannerDefault) WalkCreate(p *Create) error + func (m *PlannerDefault) WalkDelete(p *Delete) error + func (m *PlannerDefault) WalkDrop(p *Drop) error + func (m *PlannerDefault) WalkInsert(p *Insert) error + func (m *PlannerDefault) WalkInto(p *Into) error + func (m *PlannerDefault) WalkLiteralQuery(p *Select) error + func (m *PlannerDefault) WalkPreparedStatement(p *PreparedStatement) error + func (m *PlannerDefault) WalkProjectionFinal(p *Select) error + func (m *PlannerDefault) WalkProjectionSource(p *Source) error + func (m *PlannerDefault) WalkSelect(p *Select) error + func (m *PlannerDefault) WalkSourceSelect(p *Source) error + func (m *PlannerDefault) WalkUpdate(p *Update) error + func (m *PlannerDefault) WalkUpsert(p *Upsert) error + type PreparedStatement struct + Stmt *rel.PreparedStatement + func (m *PreparedStatement) Walk(p Planner) error + type Projection struct + Final bool + P *Select + Proj *rel.Projection + Stmt *rel.SqlSelect + func NewProjectionFinal(ctx *Context, p *Select) (*Projection, error) + func NewProjectionInProcess(stmt *rel.SqlSelect) *Projection + func NewProjectionStatic(proj *rel.Projection) *Projection + func ProjectionFromPB(pb *PlanPb, sel *rel.SqlSelect) *Projection + func (m *Projection) Equal(t Task) bool + func (m *Projection) ToPb() (*PlanPb, error) + type Proto interface + type SchemaLoader func(name string) (*schema.Schema, error) + type Select struct + ChildDag bool + Ctx *Context + From []*Source + Stmt *rel.SqlSelect + func SelectFromPB(pb *PlanPb, loader SchemaLoader) (*Select, error) + func SelectPlanFromPbBytes(pb []byte, loader SchemaLoader) (*Select, error) + func (m *Select) Equal(t Task) bool + func (m *Select) IsSchemaQuery() bool + func (m *Select) Marshal() ([]byte, error) + func (m *Select) MarshalTo(data []byte) (int, error) + func (m *Select) NeedsFinalProjection() bool + func (m *Select) Size() (n int) + func (m *Select) Unmarshal(data []byte) error + func (m *Select) Walk(p Planner) error + type SelectPb struct + Context *ContextPb + Select *rel.SqlSelectPb + XXX_unrecognized []byte + func (*SelectPb) Descriptor() ([]byte, []int) + func (*SelectPb) ProtoMessage() + func (m *SelectPb) Marshal() (data []byte, err error) + func (m *SelectPb) MarshalTo(data []byte) (int, error) + func (m *SelectPb) Reset() + func (m *SelectPb) Size() (n int) + func (m *SelectPb) String() string + func (m *SelectPb) Unmarshal(data []byte) error + type SelectTask interface + Equal func(Task) bool + type Source struct + Cols []string + Conn schema.Conn + Custom u.JsonHelper + DataSource schema.Source + ExecPlan Proto + Proj *rel.Projection + Schema *schema.Schema + Static []driver.Value + Stmt *rel.SqlSource + Tbl *schema.Table + func NewSource(ctx *Context, stmt *rel.SqlSource, isFinal bool) (*Source, error) + func NewSourceStaticPlan(ctx *Context) *Source + func SourceFromPB(pb *PlanPb, ctx *Context) (*Source, error) + func (m *Source) Context() *Context + func (m *Source) Equal(t Task) bool + func (m *Source) IsSchemaQuery() bool + func (m *Source) LoadConn() error + func (m *Source) Marshal() ([]byte, error) + func (m *Source) MarshalTo(data []byte) (n int, err error) + func (m *Source) Size() (n int) + func (m *Source) ToPb() (*PlanPb, error) + func (m *Source) Unmarshal(data []byte) error + func (m *Source) Walk(p Planner) error + type SourcePb struct + Complete bool + Custom []byte + Final bool + Join bool + NeedsHashableKey bool + Projection *rel.ProjectionPb + SourceExec bool + SqlSource *rel.SqlSourcePb + XXX_unrecognized []byte + func (*SourcePb) Descriptor() ([]byte, []int) + func (*SourcePb) ProtoMessage() + func (m *SourcePb) Marshal() (data []byte, err error) + func (m *SourcePb) MarshalTo(data []byte) (int, error) + func (m *SourcePb) Reset() + func (m *SourcePb) Size() (n int) + func (m *SourcePb) String() string + func (m *SourcePb) Unmarshal(data []byte) error + type SourcePlanner interface + WalkSourceSelect func(pl Planner, s *Source) (Task, error) + type Task interface + Add func(Task) error + Children func() []Task + Equal func(Task) bool + IsParallel func() bool + IsSequential func() bool + SetParallel func() + SetSequential func() + ToPb func() (*PlanPb, error) + Walk func(p Planner) error + func SelectTaskFromTaskPb(pb *PlanPb, ctx *Context, sel *rel.SqlSelect) (Task, error) + func WalkStmt(ctx *Context, stmt rel.SqlStatement, planner Planner) (Task, error) + type Update struct + Source schema.ConnUpsert + Stmt *rel.SqlUpdate + func (m *Update) Walk(p Planner) error + type Upsert struct + Source schema.ConnUpsert + Stmt *rel.SqlUpsert + func (m *Upsert) Walk(p Planner) error + type Where struct + Final bool + Stmt *rel.SqlSelect + func NewWhere(stmt *rel.SqlSelect) *Where + func NewWhereFinal(stmt *rel.SqlSelect) *Where + func WhereFromPB(pb *PlanPb) *Where + func (m *Where) Equal(t Task) bool + func (m *Where) ToPb() (*PlanPb, error) + type WherePb struct + Final bool + Select *rel.SqlSelectPb + XXX_unrecognized []byte + func (*WherePb) Descriptor() ([]byte, []int) + func (*WherePb) ProtoMessage() + func (m *WherePb) Marshal() (data []byte, err error) + func (m *WherePb) MarshalTo(data []byte) (int, error) + func (m *WherePb) Reset() + func (m *WherePb) Size() (n int) + func (m *WherePb) String() string + func (m *WherePb) Unmarshal(data []byte) error