Documentation ¶
Index ¶
- Constants
- Variables
- func CompareV3AndGen4Errors(v3Err, gen4Err error) error
- func DBDDLRegister(name string, plugin DBDDLPlugin)
- func Exists(m Match, p Primitive) bool
- func GenericJoin(input interface{}, f func(interface{}) string) string
- func InsertVarName(col sqlparser.ColIdent, rowNum int) string
- type AggregateOpcode
- type AggregateParams
- type AlterVSchema
- func (cached *AlterVSchema) CachedSize(alloc bool) int64
- func (v *AlterVSchema) GetFields(vcursor VCursor, bindVars map[string]*query.BindVariable) (*sqltypes.Result, error)
- func (v *AlterVSchema) GetKeyspaceName() string
- func (v *AlterVSchema) GetTableName() string
- func (AlterVSchema) Inputs() []Primitive
- func (AlterVSchema) NeedsTransaction() bool
- func (v *AlterVSchema) RouteType() string
- func (v *AlterVSchema) TryExecute(vcursor VCursor, bindVars map[string]*query.BindVariable, wantfields bool) (*sqltypes.Result, error)
- func (v *AlterVSchema) TryStreamExecute(vcursor VCursor, bindVars map[string]*query.BindVariable, wantields bool, ...) error
- type Concatenate
- func (cached *Concatenate) CachedSize(alloc bool) int64
- func (c *Concatenate) GetFields(vcursor VCursor, bindVars map[string]*querypb.BindVariable) (*sqltypes.Result, error)
- func (c *Concatenate) GetKeyspaceName() string
- func (c *Concatenate) GetTableName() string
- func (c *Concatenate) Inputs() []Primitive
- func (c *Concatenate) NeedsTransaction() bool
- func (c *Concatenate) RouteType() string
- func (c *Concatenate) TryExecute(vcursor VCursor, bindVars map[string]*querypb.BindVariable, wantfields bool) (*sqltypes.Result, error)
- func (c *Concatenate) TryStreamExecute(vcursor VCursor, bindVars map[string]*querypb.BindVariable, wantfields bool, ...) error
- type DBDDL
- func (cached *DBDDL) CachedSize(alloc bool) int64
- func (c *DBDDL) GetFields(VCursor, map[string]*querypb.BindVariable) (*sqltypes.Result, error)
- func (c *DBDDL) GetKeyspaceName() string
- func (c *DBDDL) GetTableName() string
- func (DBDDL) Inputs() []Primitive
- func (DBDDL) NeedsTransaction() bool
- func (c *DBDDL) RouteType() string
- func (c *DBDDL) TryExecute(vcursor VCursor, _ map[string]*querypb.BindVariable, _ bool) (*sqltypes.Result, error)
- func (c *DBDDL) TryStreamExecute(vcursor VCursor, bindVars map[string]*querypb.BindVariable, wantfields bool, ...) error
- type DBDDLPlugin
- type DDL
- func (cached *DDL) CachedSize(alloc bool) int64
- func (ddl *DDL) GetFields(vcursor VCursor, bindVars map[string]*query.BindVariable) (*sqltypes.Result, error)
- func (ddl *DDL) GetKeyspaceName() string
- func (ddl *DDL) GetTableName() string
- func (DDL) Inputs() []Primitive
- func (DDL) NeedsTransaction() bool
- func (ddl *DDL) RouteType() string
- func (ddl *DDL) TryExecute(vcursor VCursor, bindVars map[string]*query.BindVariable, wantfields bool) (result *sqltypes.Result, err error)
- func (ddl *DDL) TryStreamExecute(vcursor VCursor, bindVars map[string]*query.BindVariable, wantfields bool, ...) error
- type DML
- type DMLOpcode
- type Delete
- func (cached *Delete) CachedSize(alloc bool) int64
- func (del *Delete) GetFields(VCursor, map[string]*querypb.BindVariable) (*sqltypes.Result, error)
- func (del *Delete) GetKeyspaceName() string
- func (del *Delete) GetTableName() string
- func (Delete) Inputs() []Primitive
- func (Delete) NeedsTransaction() bool
- func (del *Delete) RouteType() string
- func (del *Delete) TryExecute(vcursor VCursor, bindVars map[string]*querypb.BindVariable, _ bool) (*sqltypes.Result, error)
- func (del *Delete) TryStreamExecute(VCursor, map[string]*querypb.BindVariable, bool, func(*sqltypes.Result) error) error
- type Distinct
- func (cached *Distinct) CachedSize(alloc bool) int64
- func (d *Distinct) GetFields(vcursor VCursor, bindVars map[string]*querypb.BindVariable) (*sqltypes.Result, error)
- func (d *Distinct) GetKeyspaceName() string
- func (d *Distinct) GetTableName() string
- func (d *Distinct) Inputs() []Primitive
- func (d *Distinct) NeedsTransaction() bool
- func (d *Distinct) RouteType() string
- func (d *Distinct) TryExecute(vcursor VCursor, bindVars map[string]*querypb.BindVariable, wantfields bool) (*sqltypes.Result, error)
- func (d *Distinct) TryStreamExecute(vcursor VCursor, bindVars map[string]*querypb.BindVariable, wantfields bool, ...) error
- type Gen4CompareV3
- func (cached *Gen4CompareV3) CachedSize(alloc bool) int64
- func (gc *Gen4CompareV3) GetFields(vcursor VCursor, bindVars map[string]*querypb.BindVariable) (*sqltypes.Result, error)
- func (gc *Gen4CompareV3) GetGen4Primitive() Primitive
- func (gc *Gen4CompareV3) GetKeyspaceName() string
- func (gc *Gen4CompareV3) GetTableName() string
- func (gc *Gen4CompareV3) Inputs() []Primitive
- func (gc *Gen4CompareV3) NeedsTransaction() bool
- func (gc *Gen4CompareV3) RouteType() string
- func (gc *Gen4CompareV3) TryExecute(vcursor VCursor, bindVars map[string]*querypb.BindVariable, wantfields bool) (*sqltypes.Result, error)
- func (gc *Gen4CompareV3) TryStreamExecute(vcursor VCursor, bindVars map[string]*querypb.BindVariable, wantfields bool, ...) error
- type Gen4Comparer
- type Generate
- type GroupByParams
- type Insert
- func (cached *Insert) CachedSize(alloc bool) int64
- func (ins *Insert) GetFields(VCursor, map[string]*querypb.BindVariable) (*sqltypes.Result, error)
- func (ins *Insert) GetKeyspaceName() string
- func (ins *Insert) GetTableName() string
- func (Insert) Inputs() []Primitive
- func (Insert) NeedsTransaction() bool
- func (ins *Insert) RouteType() string
- func (ins *Insert) TryExecute(vcursor VCursor, bindVars map[string]*querypb.BindVariable, _ bool) (*sqltypes.Result, error)
- func (ins *Insert) TryStreamExecute(VCursor, map[string]*querypb.BindVariable, bool, func(*sqltypes.Result) error) error
- type InsertOpcode
- type Join
- func (cached *Join) CachedSize(alloc bool) int64
- func (jn *Join) GetFields(vcursor VCursor, bindVars map[string]*querypb.BindVariable) (*sqltypes.Result, error)
- func (jn *Join) GetKeyspaceName() string
- func (jn *Join) GetTableName() string
- func (jn *Join) Inputs() []Primitive
- func (jn *Join) NeedsTransaction() bool
- func (jn *Join) RouteType() string
- func (jn *Join) TryExecute(vcursor VCursor, bindVars map[string]*querypb.BindVariable, wantfields bool) (*sqltypes.Result, error)
- func (jn *Join) TryStreamExecute(vcursor VCursor, bindVars map[string]*querypb.BindVariable, wantfields bool, ...) error
- type JoinOpcode
- type Limit
- func (cached *Limit) CachedSize(alloc bool) int64
- func (l *Limit) GetFields(vcursor VCursor, bindVars map[string]*querypb.BindVariable) (*sqltypes.Result, error)
- func (l *Limit) GetKeyspaceName() string
- func (l *Limit) GetTableName() string
- func (l *Limit) Inputs() []Primitive
- func (l *Limit) NeedsTransaction() bool
- func (l *Limit) RouteType() string
- func (l *Limit) TryExecute(vcursor VCursor, bindVars map[string]*querypb.BindVariable, wantfields bool) (*sqltypes.Result, error)
- func (l *Limit) TryStreamExecute(vcursor VCursor, bindVars map[string]*querypb.BindVariable, wantfields bool, ...) error
- type Lock
- func (cached *Lock) CachedSize(alloc bool) int64
- func (l *Lock) GetFields(vcursor VCursor, bindVars map[string]*querypb.BindVariable) (*sqltypes.Result, error)
- func (l *Lock) GetKeyspaceName() string
- func (l *Lock) GetTableName() string
- func (Lock) Inputs() []Primitive
- func (Lock) NeedsTransaction() bool
- func (l *Lock) RouteType() string
- func (l *Lock) TryExecute(vcursor VCursor, bindVars map[string]*querypb.BindVariable, _ bool) (*sqltypes.Result, error)
- func (l *Lock) TryStreamExecute(vcursor VCursor, bindVars map[string]*querypb.BindVariable, wantfields bool, ...) error
- type MStream
- func (cached *MStream) CachedSize(alloc bool) int64
- func (m *MStream) GetFields(vcursor VCursor, bindVars map[string]*querypb.BindVariable) (*sqltypes.Result, error)
- func (m *MStream) GetKeyspaceName() string
- func (m *MStream) GetTableName() string
- func (MStream) Inputs() []Primitive
- func (MStream) NeedsTransaction() bool
- func (m *MStream) RouteType() string
- func (m *MStream) TryExecute(vcursor VCursor, bindVars map[string]*querypb.BindVariable, wantfields bool) (*sqltypes.Result, error)
- func (m *MStream) TryStreamExecute(vcursor VCursor, bindVars map[string]*querypb.BindVariable, wantfields bool, ...) error
- type Match
- type MemorySort
- func (cached *MemorySort) CachedSize(alloc bool) int64
- func (ms *MemorySort) GetFields(vcursor VCursor, bindVars map[string]*querypb.BindVariable) (*sqltypes.Result, error)
- func (ms *MemorySort) GetKeyspaceName() string
- func (ms *MemorySort) GetTableName() string
- func (ms *MemorySort) Inputs() []Primitive
- func (ms *MemorySort) NeedsTransaction() bool
- func (ms *MemorySort) RouteType() string
- func (ms *MemorySort) SetTruncateColumnCount(count int)
- func (ms *MemorySort) TryExecute(vcursor VCursor, bindVars map[string]*querypb.BindVariable, wantfields bool) (*sqltypes.Result, error)
- func (ms *MemorySort) TryStreamExecute(vcursor VCursor, bindVars map[string]*querypb.BindVariable, wantfields bool, ...) error
- type MergeSort
- func (cached *MergeSort) CachedSize(alloc bool) int64
- func (ms *MergeSort) GetFields(vcursor VCursor, bindVars map[string]*querypb.BindVariable) (*sqltypes.Result, error)
- func (ms *MergeSort) GetKeyspaceName() string
- func (ms *MergeSort) GetTableName() string
- func (MergeSort) Inputs() []Primitive
- func (MergeSort) NeedsTransaction() bool
- func (ms *MergeSort) RouteType() string
- func (ms *MergeSort) TryExecute(vcursor VCursor, bindVars map[string]*querypb.BindVariable, wantfields bool) (*sqltypes.Result, error)
- func (ms *MergeSort) TryStreamExecute(vcursor VCursor, bindVars map[string]*querypb.BindVariable, wantfields bool, ...) error
- type OnlineDDL
- func (cached *OnlineDDL) CachedSize(alloc bool) int64
- func (v *OnlineDDL) GetFields(vcursor VCursor, bindVars map[string]*query.BindVariable) (*sqltypes.Result, error)
- func (v *OnlineDDL) GetKeyspaceName() string
- func (v *OnlineDDL) GetTableName() string
- func (OnlineDDL) Inputs() []Primitive
- func (OnlineDDL) NeedsTransaction() bool
- func (v *OnlineDDL) RouteType() string
- func (v *OnlineDDL) TryExecute(vcursor VCursor, bindVars map[string]*query.BindVariable, wantfields bool) (result *sqltypes.Result, err error)
- func (v *OnlineDDL) TryStreamExecute(vcursor VCursor, bindVars map[string]*query.BindVariable, wantfields bool, ...) error
- type OrderByParams
- type OrderedAggregate
- func (cached *OrderedAggregate) CachedSize(alloc bool) int64
- func (oa *OrderedAggregate) GetFields(vcursor VCursor, bindVars map[string]*querypb.BindVariable) (*sqltypes.Result, error)
- func (oa *OrderedAggregate) GetKeyspaceName() string
- func (oa *OrderedAggregate) GetTableName() string
- func (oa *OrderedAggregate) Inputs() []Primitive
- func (oa *OrderedAggregate) NeedsTransaction() bool
- func (oa *OrderedAggregate) RouteType() string
- func (oa *OrderedAggregate) SetTruncateColumnCount(count int)
- func (oa *OrderedAggregate) TryExecute(vcursor VCursor, bindVars map[string]*querypb.BindVariable, wantfields bool) (*sqltypes.Result, error)
- func (oa *OrderedAggregate) TryStreamExecute(vcursor VCursor, bindVars map[string]*querypb.BindVariable, wantfields bool, ...) error
- type Plan
- type Primitive
- type PrimitiveDescription
- type Projection
- func (cached *Projection) CachedSize(alloc bool) int64
- func (p *Projection) GetFields(vcursor VCursor, bindVars map[string]*querypb.BindVariable) (*sqltypes.Result, error)
- func (p *Projection) GetKeyspaceName() string
- func (p *Projection) GetTableName() string
- func (p *Projection) Inputs() []Primitive
- func (Projection) NeedsTransaction() bool
- func (p *Projection) RouteType() string
- func (p *Projection) TryExecute(vcursor VCursor, bindVars map[string]*querypb.BindVariable, wantfields bool) (*sqltypes.Result, error)
- func (p *Projection) TryStreamExecute(vcursor VCursor, bindVars map[string]*querypb.BindVariable, wantields bool, ...) error
- type PulloutOpcode
- type PulloutSubquery
- func (cached *PulloutSubquery) CachedSize(alloc bool) int64
- func (ps *PulloutSubquery) GetFields(vcursor VCursor, bindVars map[string]*querypb.BindVariable) (*sqltypes.Result, error)
- func (ps *PulloutSubquery) GetKeyspaceName() string
- func (ps *PulloutSubquery) GetTableName() string
- func (ps *PulloutSubquery) Inputs() []Primitive
- func (ps *PulloutSubquery) NeedsTransaction() bool
- func (ps *PulloutSubquery) RouteType() string
- func (ps *PulloutSubquery) TryExecute(vcursor VCursor, bindVars map[string]*querypb.BindVariable, wantfields bool) (*sqltypes.Result, error)
- func (ps *PulloutSubquery) TryStreamExecute(vcursor VCursor, bindVars map[string]*querypb.BindVariable, wantfields bool, ...) error
- type RenameFields
- func (cached *RenameFields) CachedSize(alloc bool) int64
- func (r *RenameFields) GetFields(vcursor VCursor, bindVars map[string]*querypb.BindVariable) (*sqltypes.Result, error)
- func (r *RenameFields) GetKeyspaceName() string
- func (r *RenameFields) GetTableName() string
- func (r *RenameFields) Inputs() []Primitive
- func (RenameFields) NeedsTransaction() bool
- func (r *RenameFields) RouteType() string
- func (r *RenameFields) TryExecute(vcursor VCursor, bindVars map[string]*querypb.BindVariable, wantfields bool) (*sqltypes.Result, error)
- func (r *RenameFields) TryStreamExecute(vcursor VCursor, bindVars map[string]*querypb.BindVariable, wantfields bool, ...) error
- type ReplaceVariables
- func (cached *ReplaceVariables) CachedSize(alloc bool) int64
- func (r *ReplaceVariables) GetFields(vcursor VCursor, bindVars map[string]*querypb.BindVariable) (*sqltypes.Result, error)
- func (r *ReplaceVariables) GetKeyspaceName() string
- func (r *ReplaceVariables) GetTableName() string
- func (r *ReplaceVariables) Inputs() []Primitive
- func (ReplaceVariables) NeedsTransaction() bool
- func (r *ReplaceVariables) RouteType() string
- func (r *ReplaceVariables) TryExecute(vcursor VCursor, bindVars map[string]*querypb.BindVariable, wantfields bool) (*sqltypes.Result, error)
- func (r *ReplaceVariables) TryStreamExecute(vcursor VCursor, bindVars map[string]*querypb.BindVariable, wantfields bool, ...) error
- type RevertMigration
- func (cached *RevertMigration) CachedSize(alloc bool) int64
- func (v *RevertMigration) GetFields(vcursor VCursor, bindVars map[string]*query.BindVariable) (*sqltypes.Result, error)
- func (v *RevertMigration) GetKeyspaceName() string
- func (v *RevertMigration) GetTableName() string
- func (RevertMigration) Inputs() []Primitive
- func (RevertMigration) NeedsTransaction() bool
- func (v *RevertMigration) RouteType() string
- func (v *RevertMigration) TryExecute(vcursor VCursor, bindVars map[string]*query.BindVariable, wantfields bool) (result *sqltypes.Result, err error)
- func (v *RevertMigration) TryStreamExecute(vcursor VCursor, bindVars map[string]*query.BindVariable, wantfields bool, ...) error
- type Route
- func (cached *Route) CachedSize(alloc bool) int64
- func (route *Route) GetFields(vcursor VCursor, bindVars map[string]*querypb.BindVariable) (*sqltypes.Result, error)
- func (route *Route) GetKeyspaceName() string
- func (route *Route) GetTableName() string
- func (Route) Inputs() []Primitive
- func (Route) NeedsTransaction() bool
- func (route *Route) RouteType() string
- func (route *Route) SetTruncateColumnCount(count int)
- func (route *Route) TryExecute(vcursor VCursor, bindVars map[string]*querypb.BindVariable, wantfields bool) (*sqltypes.Result, error)
- func (route *Route) TryStreamExecute(vcursor VCursor, bindVars map[string]*querypb.BindVariable, wantfields bool, ...) error
- type RouteOpcode
- type Rows
- func (cached *Rows) CachedSize(alloc bool) int64
- func (r *Rows) GetFields(VCursor, map[string]*querypb.BindVariable) (*sqltypes.Result, error)
- func (r *Rows) GetKeyspaceName() string
- func (r *Rows) GetTableName() string
- func (Rows) Inputs() []Primitive
- func (Rows) NeedsTransaction() bool
- func (r *Rows) RouteType() string
- func (r *Rows) TryExecute(VCursor, map[string]*querypb.BindVariable, bool) (*sqltypes.Result, error)
- func (r *Rows) TryStreamExecute(vcursor VCursor, bindVars map[string]*querypb.BindVariable, wantields bool, ...) error
- type SQLCalcFoundRows
- func (cached *SQLCalcFoundRows) CachedSize(alloc bool) int64
- func (s SQLCalcFoundRows) GetFields(vcursor VCursor, bindVars map[string]*querypb.BindVariable) (*sqltypes.Result, error)
- func (s SQLCalcFoundRows) GetKeyspaceName() string
- func (s SQLCalcFoundRows) GetTableName() string
- func (s SQLCalcFoundRows) Inputs() []Primitive
- func (s SQLCalcFoundRows) NeedsTransaction() bool
- func (s SQLCalcFoundRows) RouteType() string
- func (s SQLCalcFoundRows) TryExecute(vcursor VCursor, bindVars map[string]*querypb.BindVariable, wantfields bool) (*sqltypes.Result, error)
- func (s SQLCalcFoundRows) TryStreamExecute(vcursor VCursor, bindVars map[string]*querypb.BindVariable, wantfields bool, ...) error
- type Send
- func (cached *Send) CachedSize(alloc bool) int64
- func (s *Send) GetFields(vcursor VCursor, bindVars map[string]*querypb.BindVariable) (*sqltypes.Result, error)
- func (s *Send) GetKeyspaceName() string
- func (s *Send) GetTableName() string
- func (Send) Inputs() []Primitive
- func (s *Send) NeedsTransaction() bool
- func (s *Send) RouteType() string
- func (s *Send) TryExecute(vcursor VCursor, bindVars map[string]*querypb.BindVariable, wantfields bool) (*sqltypes.Result, error)
- func (s *Send) TryStreamExecute(vcursor VCursor, bindVars map[string]*querypb.BindVariable, wantfields bool, ...) error
- type SessionActions
- type SessionPrimitive
- func (cached *SessionPrimitive) CachedSize(alloc bool) int64
- func (s *SessionPrimitive) GetFields(_ VCursor, _ map[string]*querypb.BindVariable) (*sqltypes.Result, error)
- func (s *SessionPrimitive) GetKeyspaceName() string
- func (s *SessionPrimitive) GetTableName() string
- func (SessionPrimitive) Inputs() []Primitive
- func (SessionPrimitive) NeedsTransaction() bool
- func (s *SessionPrimitive) RouteType() string
- func (s *SessionPrimitive) TryExecute(vcursor VCursor, _ map[string]*querypb.BindVariable, _ bool) (*sqltypes.Result, error)
- func (s *SessionPrimitive) TryStreamExecute(vcursor VCursor, _ map[string]*querypb.BindVariable, _ bool, ...) error
- type Set
- func (cached *Set) CachedSize(alloc bool) int64
- func (s *Set) GetFields(VCursor, map[string]*querypb.BindVariable) (*sqltypes.Result, error)
- func (s *Set) GetKeyspaceName() string
- func (s *Set) GetTableName() string
- func (s *Set) Inputs() []Primitive
- func (Set) NeedsTransaction() bool
- func (s *Set) RouteType() string
- func (s *Set) TryExecute(vcursor VCursor, bindVars map[string]*querypb.BindVariable, _ bool) (*sqltypes.Result, error)
- func (s *Set) TryStreamExecute(vcursor VCursor, bindVars map[string]*querypb.BindVariable, wantields bool, ...) error
- type SetOp
- type SimpleProjection
- func (cached *SimpleProjection) CachedSize(alloc bool) int64
- func (sc *SimpleProjection) GetFields(vcursor VCursor, bindVars map[string]*querypb.BindVariable) (*sqltypes.Result, error)
- func (sc *SimpleProjection) GetKeyspaceName() string
- func (sc *SimpleProjection) GetTableName() string
- func (sc *SimpleProjection) Inputs() []Primitive
- func (sc *SimpleProjection) NeedsTransaction() bool
- func (sc *SimpleProjection) RouteType() string
- func (sc *SimpleProjection) TryExecute(vcursor VCursor, bindVars map[string]*querypb.BindVariable, wantfields bool) (*sqltypes.Result, error)
- func (sc *SimpleProjection) TryStreamExecute(vcursor VCursor, bindVars map[string]*querypb.BindVariable, wantfields bool, ...) error
- type SingleRow
- func (s *SingleRow) GetFields(_ VCursor, _ map[string]*query.BindVariable) (*sqltypes.Result, error)
- func (s *SingleRow) GetKeyspaceName() string
- func (s *SingleRow) GetTableName() string
- func (SingleRow) Inputs() []Primitive
- func (SingleRow) NeedsTransaction() bool
- func (s *SingleRow) RouteType() string
- func (s *SingleRow) TryExecute(VCursor, map[string]*query.BindVariable, bool) (*sqltypes.Result, error)
- func (s *SingleRow) TryStreamExecute(_ VCursor, _ map[string]*query.BindVariable, _ bool, ...) error
- type StreamExecutor
- type SysVarCheckAndIgnore
- type SysVarIgnore
- type SysVarReservedConn
- type SysVarSetAware
- type Update
- func (cached *Update) CachedSize(alloc bool) int64
- func (upd *Update) GetFields(vcursor VCursor, bindVars map[string]*querypb.BindVariable) (*sqltypes.Result, error)
- func (upd *Update) GetKeyspaceName() string
- func (upd *Update) GetTableName() string
- func (Update) Inputs() []Primitive
- func (Update) NeedsTransaction() bool
- func (upd *Update) RouteType() string
- func (upd *Update) TryExecute(vcursor VCursor, bindVars map[string]*querypb.BindVariable, wantfields bool) (*sqltypes.Result, error)
- func (upd *Update) TryStreamExecute(vcursor VCursor, bindVars map[string]*querypb.BindVariable, wantfields bool, ...) error
- type UpdateTarget
- func (cached *UpdateTarget) CachedSize(alloc bool) int64
- func (updTarget *UpdateTarget) GetFields(vcursor VCursor, bindVars map[string]*query.BindVariable) (*sqltypes.Result, error)
- func (updTarget *UpdateTarget) GetKeyspaceName() string
- func (updTarget *UpdateTarget) GetTableName() string
- func (UpdateTarget) Inputs() []Primitive
- func (UpdateTarget) NeedsTransaction() bool
- func (updTarget *UpdateTarget) RouteType() string
- func (updTarget *UpdateTarget) TryExecute(vcursor VCursor, bindVars map[string]*query.BindVariable, wantfields bool) (*sqltypes.Result, error)
- func (updTarget *UpdateTarget) TryStreamExecute(vcursor VCursor, bindVars map[string]*query.BindVariable, wantfields bool, ...) error
- type UserDefinedVariable
- type VCursor
- type VStream
- func (cached *VStream) CachedSize(alloc bool) int64
- func (v *VStream) GetFields(_ VCursor, _ map[string]*querypb.BindVariable) (*sqltypes.Result, error)
- func (v *VStream) GetKeyspaceName() string
- func (v *VStream) GetTableName() string
- func (VStream) Inputs() []Primitive
- func (VStream) NeedsTransaction() bool
- func (v *VStream) RouteType() string
- func (v *VStream) TryExecute(_ VCursor, _ map[string]*querypb.BindVariable, wantfields bool) (*sqltypes.Result, error)
- func (v *VStream) TryStreamExecute(vcursor VCursor, bindVars map[string]*querypb.BindVariable, wantfields bool, ...) error
- type VindexFunc
- func (cached *VindexFunc) CachedSize(alloc bool) int64
- func (vf *VindexFunc) GetFields(vcursor VCursor, bindVars map[string]*querypb.BindVariable) (*sqltypes.Result, error)
- func (vf *VindexFunc) GetKeyspaceName() string
- func (vf *VindexFunc) GetTableName() string
- func (VindexFunc) Inputs() []Primitive
- func (VindexFunc) NeedsTransaction() bool
- func (vf *VindexFunc) RouteType() string
- func (vf *VindexFunc) TryExecute(vcursor VCursor, bindVars map[string]*querypb.BindVariable, wantfields bool) (*sqltypes.Result, error)
- func (vf *VindexFunc) TryStreamExecute(vcursor VCursor, bindVars map[string]*querypb.BindVariable, wantfields bool, ...) error
- type VindexOpcode
- type VindexValues
Constants ¶
const ( // Unsharded is for routing a dml statement // to an unsharded keyspace. Unsharded = DMLOpcode(iota) // Equal is for routing an dml statement to a single shard. // Requires: A Vindex, and a single Value. Equal // In is for routing an dml statement to a multi shard. // Requires: A Vindex, and a multi Values. In // Scatter is for routing a scattered dml statement. Scatter // ByDestination is to route explicitly to a given target destination. // Is used when the query explicitly sets a target destination: // in the clause e.g: UPDATE `keyspace[-]`.x1 SET foo=1 ByDestination )
This is the list of UpdateOpcode values.
const ( // InsertUnsharded is for routing an insert statement // to an unsharded keyspace. InsertUnsharded = InsertOpcode(iota) // InsertSharded is for routing an insert statement // to individual shards. Requires: A list of Values, one // for each ColVindex. If the table has an Autoinc column, // A Generate subplan must be created. InsertSharded // InsertShardedIgnore is for INSERT IGNORE and // INSERT...ON DUPLICATE KEY constructs. InsertShardedIgnore )
const ( InnerJoin = JoinOpcode(iota) LeftJoin )
This is the list of JoinOpcode values.
const ( AggregateCount = AggregateOpcode(iota) AggregateSum AggregateMin AggregateMax AggregateCountDistinct AggregateSumDistinct AggregateGtid )
These constants list the possible aggregate opcodes.
const ( // SeqVarName is a reserved bind var name for sequence values. SeqVarName = "__seq" // ListVarName is a reserved bind var name for list vars. // This is used for sending different IN clause values // to different shards. ListVarName = "__vals" )
const ( PulloutValue = PulloutOpcode(iota) PulloutIn PulloutNotIn PulloutExists )
This is the list of PulloutOpcode values.
const ( // SelectUnsharded is the opcode for routing a // select statement to an unsharded database. SelectUnsharded = RouteOpcode(iota) // SelectEqualUnique is for routing a query to // a single shard. Requires: A Unique Vindex, and // a single Value. SelectEqualUnique // SelectEqual is for routing a query using a // non-unique vindex. Requires: A Vindex, and // a single Value. SelectEqual // SelectIN is for routing a query that has an IN // clause using a Vindex. Requires: A Vindex, // and a Values list. SelectIN // SelectMultiEqual is the opcode for routing a query // based on multiple vindex input values, similar to // SelectIN, but the query sent to each shard is the // same. SelectMultiEqual // SelectScatter is for routing a scatter query // to all shards of a keyspace. SelectScatter // SelectNext is for fetching from a sequence. SelectNext // SelectDBA is for executing a DBA statement. SelectDBA // SelectReference is for fetching from a reference table. SelectReference // SelectNone is used for queries that always return empty values SelectNone // NumRouteOpcodes is the number of opcodes NumRouteOpcodes )
This is the list of RouteOpcode values.
const ( VindexNone = VindexOpcode(iota) VindexMap NumVindexCodes )
These are opcode values for VindexFunc.
const ShardName = "__vt_shard"
ShardName as key for setting shard name in bind variables map
Variables ¶
var ErrWrongNumberOfColumnsInSelect = vterrors.NewErrorf(vtrpcpb.Code_FAILED_PRECONDITION, vterrors.WrongNumberOfColumnsInSelect, "The used SELECT statements have a different number of columns")
ErrWrongNumberOfColumnsInSelect is an error
var ( // OpcodeType keeps track of the known output types for different aggregate functions OpcodeType = map[AggregateOpcode]querypb.Type{ AggregateCountDistinct: sqltypes.Int64, AggregateCount: sqltypes.Int64, AggregateSumDistinct: sqltypes.Decimal, AggregateSum: sqltypes.Decimal, AggregateGtid: sqltypes.VarChar, } )
var SupportedAggregates = map[string]AggregateOpcode{ "count": AggregateCount, "sum": AggregateSum, "min": AggregateMin, "max": AggregateMax, "count_distinct": AggregateCountDistinct, "sum_distinct": AggregateSumDistinct, "vgtid": AggregateGtid, }
SupportedAggregates maps the list of supported aggregate functions to their opcodes.
Functions ¶
func CompareV3AndGen4Errors ¶ added in v0.12.0
CompareV3AndGen4Errors compares the two errors, and if they don't match, produces an error
func DBDDLRegister ¶ added in v0.10.0
func DBDDLRegister(name string, plugin DBDDLPlugin)
DBDDLRegister registers a dbDDL plugin under the specified name. A duplicate plugin will generate a panic.
func Exists ¶
Exists traverses recursively down the Primitive tree structure, and returns true when Match returns true
func GenericJoin ¶
GenericJoin will iterate over arrays, slices or maps, and executes the f function to get a string representation of each element, and then uses strings.Join() join all the strings into a single one
Types ¶
type AggregateOpcode ¶
type AggregateOpcode int
AggregateOpcode is the aggregation Opcode.
func (AggregateOpcode) MarshalJSON ¶
func (code AggregateOpcode) MarshalJSON() ([]byte, error)
MarshalJSON serializes the AggregateOpcode as a JSON string. It's used for testing and diagnostics.
func (AggregateOpcode) String ¶
func (code AggregateOpcode) String() string
type AggregateParams ¶
type AggregateParams struct { Opcode AggregateOpcode Col int // These are used only for distinct opcodes. KeyCol int WCol int WAssigned bool Alias string `json:",omitempty"` Expr sqlparser.Expr }
AggregateParams specify the parameters for each aggregation. It contains the opcode and input column number.
func (*AggregateParams) CachedSize ¶ added in v0.10.0
func (cached *AggregateParams) CachedSize(alloc bool) int64
func (*AggregateParams) String ¶
func (ap *AggregateParams) String() string
type AlterVSchema ¶
type AlterVSchema struct { Keyspace *vindexes.Keyspace AlterVschemaDDL *sqlparser.AlterVschema // contains filtered or unexported fields }
AlterVSchema operator applies changes to VSchema
func (*AlterVSchema) CachedSize ¶ added in v0.10.0
func (cached *AlterVSchema) CachedSize(alloc bool) int64
func (*AlterVSchema) GetFields ¶
func (v *AlterVSchema) GetFields(vcursor VCursor, bindVars map[string]*query.BindVariable) (*sqltypes.Result, error)
GetFields implements the Primitive interface
func (*AlterVSchema) GetKeyspaceName ¶
func (v *AlterVSchema) GetKeyspaceName() string
GetKeyspaceName implements the Primitive interface
func (*AlterVSchema) GetTableName ¶
func (v *AlterVSchema) GetTableName() string
GetTableName implements the Primitive interface
func (AlterVSchema) NeedsTransaction ¶
func (AlterVSchema) NeedsTransaction() bool
func (*AlterVSchema) RouteType ¶
func (v *AlterVSchema) RouteType() string
RouteType implements the Primitive interface
func (*AlterVSchema) TryExecute ¶ added in v0.12.0
func (v *AlterVSchema) TryExecute(vcursor VCursor, bindVars map[string]*query.BindVariable, wantfields bool) (*sqltypes.Result, error)
TryExecute implements the Primitive interface
func (*AlterVSchema) TryStreamExecute ¶ added in v0.12.0
func (v *AlterVSchema) TryStreamExecute(vcursor VCursor, bindVars map[string]*query.BindVariable, wantields bool, callback func(*sqltypes.Result) error) error
TryStreamExecute implements the Primitive interface
type Concatenate ¶
type Concatenate struct {
Sources []Primitive
}
Concatenate specified the parameter for concatenate primitive
func (*Concatenate) CachedSize ¶ added in v0.10.0
func (cached *Concatenate) CachedSize(alloc bool) int64
func (*Concatenate) GetFields ¶
func (c *Concatenate) GetFields(vcursor VCursor, bindVars map[string]*querypb.BindVariable) (*sqltypes.Result, error)
GetFields fetches the field info.
func (*Concatenate) GetKeyspaceName ¶
func (c *Concatenate) GetKeyspaceName() string
GetKeyspaceName specifies the Keyspace that this primitive routes to
func (*Concatenate) GetTableName ¶
func (c *Concatenate) GetTableName() string
GetTableName specifies the table that this primitive routes to.
func (*Concatenate) Inputs ¶
func (c *Concatenate) Inputs() []Primitive
Inputs returns the input primitives for this
func (*Concatenate) NeedsTransaction ¶
func (c *Concatenate) NeedsTransaction() bool
NeedsTransaction returns whether a transaction is needed for this primitive
func (*Concatenate) RouteType ¶
func (c *Concatenate) RouteType() string
RouteType returns a description of the query routing type used by the primitive
func (*Concatenate) TryExecute ¶ added in v0.12.0
func (c *Concatenate) TryExecute(vcursor VCursor, bindVars map[string]*querypb.BindVariable, wantfields bool) (*sqltypes.Result, error)
TryExecute performs a non-streaming exec.
func (*Concatenate) TryStreamExecute ¶ added in v0.12.0
func (c *Concatenate) TryStreamExecute(vcursor VCursor, bindVars map[string]*querypb.BindVariable, wantfields bool, callback func(*sqltypes.Result) error) error
TryStreamExecute performs a streaming exec.
type DBDDL ¶ added in v0.10.0
type DBDDL struct {
// contains filtered or unexported fields
}
DBDDL is just a container around custom database provisioning plugins The default behaviour is to just return an error
func NewDBDDL ¶ added in v0.10.0
NewDBDDL creates the engine primitive `create` will be true for CREATE, and false for DROP
func (*DBDDL) CachedSize ¶ added in v0.10.0
func (*DBDDL) GetKeyspaceName ¶ added in v0.10.0
GetKeyspaceName implements the Primitive interface
func (*DBDDL) GetTableName ¶ added in v0.10.0
GetTableName implements the Primitive interface
func (DBDDL) Inputs ¶ added in v0.10.0
func (DBDDL) Inputs() []Primitive
Inputs implements no inputs
func (DBDDL) NeedsTransaction ¶ added in v0.10.0
func (DBDDL) NeedsTransaction() bool
type DBDDLPlugin ¶ added in v0.10.0
type DBDDLPlugin interface { CreateDatabase(ctx context.Context, name string) error DropDatabase(ctx context.Context, name string) error }
DBDDLPlugin is the interface that you need to implement to add a custom CREATE/DROP DATABASE handler
type DDL ¶ added in v0.9.0
type DDL struct { Keyspace *vindexes.Keyspace SQL string DDL sqlparser.DDLStatement NormalDDL *Send OnlineDDL *OnlineDDL DirectDDLEnabled bool OnlineDDLEnabled bool CreateTempTable bool // contains filtered or unexported fields }
DDL represents a DDL statement, either normal or online DDL
func (*DDL) CachedSize ¶ added in v0.10.0
func (*DDL) GetFields ¶ added in v0.9.0
func (ddl *DDL) GetFields(vcursor VCursor, bindVars map[string]*query.BindVariable) (*sqltypes.Result, error)
GetFields implements the Primitive interface
func (*DDL) GetKeyspaceName ¶ added in v0.9.0
GetKeyspaceName implements the Primitive interface
func (*DDL) GetTableName ¶ added in v0.9.0
GetTableName implements the Primitive interface
func (DDL) NeedsTransaction ¶ added in v0.9.0
func (DDL) NeedsTransaction() bool
type DML ¶
type DML struct { // Opcode is the execution opcode. Opcode DMLOpcode // Keyspace specifies the keyspace to send the query to. Keyspace *vindexes.Keyspace // TargetDestination specifies the destination to send the query to. TargetDestination key.Destination // Query specifies the query to be executed. Query string // Vindex specifies the vindex to be used. Vindex vindexes.SingleColumn // Values specifies the vindex values to use for routing. // For now, only one value is specified. Values []sqltypes.PlanValue // Keyspace Id Vindex KsidVindex vindexes.SingleColumn // Table specifies the table for the update. Table *vindexes.Table // OwnedVindexQuery is used for updating changes in lookup vindexes. OwnedVindexQuery string // Option to override the standard behavior and allow a multi-shard update // to use single round trip autocommit. MultiShardAutocommit bool // QueryTimeout contains the optional timeout (in milliseconds) to apply to this query QueryTimeout int // contains filtered or unexported fields }
DML contains the common elements between Update and Delete plans
func (*DML) CachedSize ¶ added in v0.10.0
func (DML) NeedsTransaction ¶
func (DML) NeedsTransaction() bool
type DMLOpcode ¶
type DMLOpcode int
DMLOpcode is a number representing the opcode for the Update or Delete primitve.
type Delete ¶
type Delete struct { DML // contains filtered or unexported fields }
Delete represents the instructions to perform a delete.
func (*Delete) CachedSize ¶ added in v0.10.0
func (*Delete) GetKeyspaceName ¶
GetKeyspaceName specifies the Keyspace that this primitive routes to.
func (*Delete) GetTableName ¶
GetTableName specifies the table that this primitive routes to.
func (Delete) NeedsTransaction ¶
func (Delete) NeedsTransaction() bool
func (*Delete) RouteType ¶
RouteType returns a description of the query routing type used by the primitive
type Distinct ¶ added in v0.9.0
type Distinct struct {
Source Primitive
}
Distinct Primitive is used to uniqueify results
func (*Distinct) CachedSize ¶ added in v0.10.0
func (*Distinct) GetFields ¶ added in v0.9.0
func (d *Distinct) GetFields(vcursor VCursor, bindVars map[string]*querypb.BindVariable) (*sqltypes.Result, error)
GetFields implements the Primitive interface
func (*Distinct) GetKeyspaceName ¶ added in v0.9.0
GetKeyspaceName implements the Primitive interface
func (*Distinct) GetTableName ¶ added in v0.9.0
GetTableName implements the Primitive interface
func (*Distinct) NeedsTransaction ¶ added in v0.9.0
NeedsTransaction implements the Primitive interface
type Gen4CompareV3 ¶ added in v0.12.0
Gen4CompareV3 is a Primitive used to compare V3 and Gen4's plans.
func (*Gen4CompareV3) CachedSize ¶ added in v0.12.0
func (cached *Gen4CompareV3) CachedSize(alloc bool) int64
func (*Gen4CompareV3) GetFields ¶ added in v0.12.0
func (gc *Gen4CompareV3) GetFields(vcursor VCursor, bindVars map[string]*querypb.BindVariable) (*sqltypes.Result, error)
GetFields implements the Primitive interface
func (*Gen4CompareV3) GetGen4Primitive ¶ added in v0.12.0
func (gc *Gen4CompareV3) GetGen4Primitive() Primitive
GetGen4Primitive implements the Gen4Comparer interface
func (*Gen4CompareV3) GetKeyspaceName ¶ added in v0.12.0
func (gc *Gen4CompareV3) GetKeyspaceName() string
GetKeyspaceName implements the Primitive interface
func (*Gen4CompareV3) GetTableName ¶ added in v0.12.0
func (gc *Gen4CompareV3) GetTableName() string
GetTableName implements the Primitive interface
func (*Gen4CompareV3) Inputs ¶ added in v0.12.0
func (gc *Gen4CompareV3) Inputs() []Primitive
Inputs implements the Primitive interface
func (*Gen4CompareV3) NeedsTransaction ¶ added in v0.12.0
func (gc *Gen4CompareV3) NeedsTransaction() bool
NeedsTransaction implements the Primitive interface
func (*Gen4CompareV3) RouteType ¶ added in v0.12.0
func (gc *Gen4CompareV3) RouteType() string
RouteType implements the Primitive interface
func (*Gen4CompareV3) TryExecute ¶ added in v0.12.0
func (gc *Gen4CompareV3) TryExecute( vcursor VCursor, bindVars map[string]*querypb.BindVariable, wantfields bool, ) (*sqltypes.Result, error)
TryExecute implements the Primitive interface
func (*Gen4CompareV3) TryStreamExecute ¶ added in v0.12.0
func (gc *Gen4CompareV3) TryStreamExecute( vcursor VCursor, bindVars map[string]*querypb.BindVariable, wantfields bool, callback func(*sqltypes.Result) error, ) error
TryStreamExecute implements the Primitive interface
type Gen4Comparer ¶ added in v0.12.0
Gen4Comparer interfaces all Primitive used to compare Gen4 with other planners (V3, MySQL, ...).
type Generate ¶
type Generate struct { Keyspace *vindexes.Keyspace Query string // Values are the supplied values for the column, which // will be stored as a list within the PlanValue. New // values will be generated based on how many were not // supplied (NULL). Values sqltypes.PlanValue }
Generate represents the instruction to generate a value from a sequence.
func (*Generate) CachedSize ¶ added in v0.10.0
type GroupByParams ¶ added in v0.12.0
GroupByParams specify the grouping key to be used.
func (*GroupByParams) CachedSize ¶ added in v0.12.0
func (cached *GroupByParams) CachedSize(alloc bool) int64
func (GroupByParams) String ¶ added in v0.12.0
func (gbp GroupByParams) String() string
String returns a string. Used for plan descriptions
type Insert ¶
type Insert struct { // Opcode is the execution opcode. Opcode InsertOpcode // Keyspace specifies the keyspace to send the query to. Keyspace *vindexes.Keyspace // Query specifies the query to be executed. // For InsertSharded plans, this value is unused, // and Prefix, Mid and Suffix are used instead. Query string // VindexValues specifies values for all the vindex columns. // This is a three-dimensional data structure: // Insert.Values[i] represents the values to be inserted for the i'th colvindex (i < len(Insert.Table.ColumnVindexes)) // Insert.Values[i].Values[j] represents values for the j'th column of the given colVindex (j < len(colVindex[i].Columns) // Insert.Values[i].Values[j].Values[k] represents the value pulled from row k for that column: (k < len(ins.rows)) VindexValues []sqltypes.PlanValue // Table specifies the table for the insert. Table *vindexes.Table // Generate is only set for inserts where a sequence must be generated. Generate *Generate // Prefix, Mid and Suffix are for sharded insert plans. Prefix string Mid []string Suffix string // Option to override the standard behavior and allow a multi-shard insert // to use single round trip autocommit. // // This is a clear violation of the SQL semantics since it means the statement // is not atomic in the presence of PK conflicts on one shard and not another. // However some application use cases would prefer that the statement partially // succeed in order to get the performance benefits of autocommit. MultiShardAutocommit bool // QueryTimeout contains the optional timeout (in milliseconds) to apply to this query QueryTimeout int // contains filtered or unexported fields }
Insert represents the instructions to perform an insert operation.
func NewInsert ¶
func NewInsert(opcode InsertOpcode, keyspace *vindexes.Keyspace, vindexValues []sqltypes.PlanValue, table *vindexes.Table, prefix string, mid []string, suffix string) *Insert
NewInsert creates a new Insert.
func NewQueryInsert ¶
func NewQueryInsert(opcode InsertOpcode, keyspace *vindexes.Keyspace, query string) *Insert
NewQueryInsert creates an Insert with a query string.
func NewSimpleInsert ¶
func NewSimpleInsert(opcode InsertOpcode, table *vindexes.Table, keyspace *vindexes.Keyspace) *Insert
NewSimpleInsert creates an Insert for a Table.
func (*Insert) CachedSize ¶ added in v0.10.0
func (*Insert) GetKeyspaceName ¶
GetKeyspaceName specifies the Keyspace that this primitive routes to.
func (*Insert) GetTableName ¶
GetTableName specifies the table that this primitive routes to.
func (Insert) NeedsTransaction ¶
func (Insert) NeedsTransaction() bool
func (*Insert) RouteType ¶
RouteType returns a description of the query routing type used by the primitive
type InsertOpcode ¶
type InsertOpcode int
InsertOpcode is a number representing the opcode for the Insert primitive.
func (InsertOpcode) MarshalJSON ¶
func (code InsertOpcode) MarshalJSON() ([]byte, error)
MarshalJSON serializes the InsertOpcode as a JSON string. It's used for testing and diagnostics.
type Join ¶
type Join struct { Opcode JoinOpcode // Left and Right are the LHS and RHS primitives // of the Join. They can be any primitive. Left, Right Primitive `json:",omitempty"` // Cols defines which columns from the left // or right results should be used to build the // return result. For results coming from the // left query, the index values go as -1, -2, etc. // For the right query, they're 1, 2, etc. // If Cols is {-1, -2, 1, 2}, it means that // the returned result will be {Left0, Left1, Right0, Right1}. Cols []int `json:",omitempty"` // Vars defines the list of joinVars that need to // be built from the LHS result before invoking // the RHS subqquery. Vars map[string]int `json:",omitempty"` }
Join specifies the parameters for a join primitive.
func (*Join) CachedSize ¶ added in v0.10.0
func (*Join) GetFields ¶
func (jn *Join) GetFields(vcursor VCursor, bindVars map[string]*querypb.BindVariable) (*sqltypes.Result, error)
GetFields fetches the field info.
func (*Join) GetKeyspaceName ¶
GetKeyspaceName specifies the Keyspace that this primitive routes to.
func (*Join) GetTableName ¶
GetTableName specifies the table that this primitive routes to.
func (*Join) NeedsTransaction ¶
NeedsTransaction implements the Primitive interface
func (*Join) RouteType ¶
RouteType returns a description of the query routing type used by the primitive
type JoinOpcode ¶
type JoinOpcode int
JoinOpcode is a number representing the opcode for the Join primitive.
func (JoinOpcode) MarshalJSON ¶
func (code JoinOpcode) MarshalJSON() ([]byte, error)
MarshalJSON serializes the JoinOpcode as a JSON string. It's used for testing and diagnostics.
func (JoinOpcode) String ¶
func (code JoinOpcode) String() string
type Limit ¶
Limit is a primitive that performs the LIMIT operation.
func (*Limit) CachedSize ¶ added in v0.10.0
func (*Limit) GetFields ¶
func (l *Limit) GetFields(vcursor VCursor, bindVars map[string]*querypb.BindVariable) (*sqltypes.Result, error)
GetFields implements the Primitive interface.
func (*Limit) GetKeyspaceName ¶
GetKeyspaceName specifies the Keyspace that this primitive routes to.
func (*Limit) GetTableName ¶
GetTableName specifies the table that this primitive routes to.
func (*Limit) NeedsTransaction ¶
NeedsTransaction implements the Primitive interface.
func (*Limit) RouteType ¶
RouteType returns a description of the query routing type used by the primitive
type Lock ¶ added in v0.8.0
type Lock struct { // Keyspace specifies the keyspace to send the query to. Keyspace *vindexes.Keyspace // TargetDestination specifies an explicit target destination to send the query to. TargetDestination key.Destination // Query specifies the query to be executed. Query string // contains filtered or unexported fields }
Lock primitive will execute sql containing lock functions
func (*Lock) CachedSize ¶ added in v0.10.0
func (*Lock) GetFields ¶ added in v0.8.0
func (l *Lock) GetFields(vcursor VCursor, bindVars map[string]*querypb.BindVariable) (*sqltypes.Result, error)
GetFields is part of the Primitive interface
func (*Lock) GetKeyspaceName ¶ added in v0.8.0
GetKeyspaceName is part of the Primitive interface
func (*Lock) GetTableName ¶ added in v0.8.0
GetTableName is part of the Primitive interface
func (Lock) NeedsTransaction ¶ added in v0.8.0
func (Lock) NeedsTransaction() bool
type MStream ¶ added in v0.11.0
type MStream struct { // Keyspace specifies the keyspace to stream messages from Keyspace *vindexes.Keyspace // TargetDestination specifies an explicit target destination to stream messages from TargetDestination key.Destination // TableName specifies the table on which stream will be executed. TableName string // contains filtered or unexported fields }
MStream is an operator for message streaming from specific keyspace, destination
func (*MStream) CachedSize ¶ added in v0.11.0
func (*MStream) GetFields ¶ added in v0.11.0
func (m *MStream) GetFields(vcursor VCursor, bindVars map[string]*querypb.BindVariable) (*sqltypes.Result, error)
GetFields implements the Primitive interface
func (*MStream) GetKeyspaceName ¶ added in v0.11.0
GetKeyspaceName implements the Primitive interface
func (*MStream) GetTableName ¶ added in v0.11.0
GetTableName implements the Primitive interface
func (MStream) Inputs ¶ added in v0.11.0
func (MStream) Inputs() []Primitive
Inputs implements no inputs
func (MStream) NeedsTransaction ¶ added in v0.11.0
func (MStream) NeedsTransaction() bool
type MemorySort ¶
type MemorySort struct { UpperLimit sqltypes.PlanValue OrderBy []OrderByParams Input Primitive // TruncateColumnCount specifies the number of columns to return // in the final result. Rest of the columns are truncated // from the result received. If 0, no truncation happens. TruncateColumnCount int `json:",omitempty"` }
MemorySort is a primitive that performs in-memory sorting.
func (*MemorySort) CachedSize ¶ added in v0.10.0
func (cached *MemorySort) CachedSize(alloc bool) int64
func (*MemorySort) GetFields ¶
func (ms *MemorySort) GetFields(vcursor VCursor, bindVars map[string]*querypb.BindVariable) (*sqltypes.Result, error)
GetFields satisfies the Primitive interface.
func (*MemorySort) GetKeyspaceName ¶
func (ms *MemorySort) GetKeyspaceName() string
GetKeyspaceName specifies the Keyspace that this primitive routes to.
func (*MemorySort) GetTableName ¶
func (ms *MemorySort) GetTableName() string
GetTableName specifies the table that this primitive routes to.
func (*MemorySort) Inputs ¶
func (ms *MemorySort) Inputs() []Primitive
Inputs returns the input to memory sort
func (*MemorySort) NeedsTransaction ¶
func (ms *MemorySort) NeedsTransaction() bool
NeedsTransaction implements the Primitive interface
func (*MemorySort) RouteType ¶
func (ms *MemorySort) RouteType() string
RouteType returns a description of the query routing type used by the primitive.
func (*MemorySort) SetTruncateColumnCount ¶
func (ms *MemorySort) SetTruncateColumnCount(count int)
SetTruncateColumnCount sets the truncate column count.
func (*MemorySort) TryExecute ¶ added in v0.12.0
func (ms *MemorySort) TryExecute(vcursor VCursor, bindVars map[string]*querypb.BindVariable, wantfields bool) (*sqltypes.Result, error)
TryExecute satisfies the Primitive interface.
func (*MemorySort) TryStreamExecute ¶ added in v0.12.0
func (ms *MemorySort) TryStreamExecute(vcursor VCursor, bindVars map[string]*querypb.BindVariable, wantfields bool, callback func(*sqltypes.Result) error) error
TryStreamExecute satisfies the Primitive interface.
type MergeSort ¶
type MergeSort struct { Primitives []StreamExecutor OrderBy []OrderByParams ScatterErrorsAsWarnings bool // contains filtered or unexported fields }
MergeSort performs a merge-sort of rows returned by each Input. This should only be used for StreamExecute. One row from each stream is added to the merge-sorter heap. Every time a value is pulled out of the heap, a new value is added to it from the stream that was the source of the value that was pulled out. Since the input streams are sorted the same way that the heap is sorted, this guarantees that the merged stream will also be sorted the same way. MergeSort only supports the StreamExecute function of a Primitive. So, it cannot be used like other Primitives in VTGate. However, it satisfies the Primitive API so that vdiff can use it. In that situation, only StreamExecute is used.
func (*MergeSort) CachedSize ¶ added in v0.10.0
func (*MergeSort) GetFields ¶
func (ms *MergeSort) GetFields(vcursor VCursor, bindVars map[string]*querypb.BindVariable) (*sqltypes.Result, error)
GetFields is not supported.
func (*MergeSort) GetKeyspaceName ¶
GetKeyspaceName satisfies Primitive.
func (*MergeSort) GetTableName ¶
GetTableName satisfies Primitive.
func (MergeSort) NeedsTransaction ¶
func (MergeSort) NeedsTransaction() bool
type OnlineDDL ¶ added in v0.8.0
type OnlineDDL struct { Keyspace *vindexes.Keyspace DDL sqlparser.DDLStatement SQL string DDLStrategySetting *schema.DDLStrategySetting // TargetDestination specifies an explicit target destination to send the query to. TargetDestination key.Destination // contains filtered or unexported fields }
OnlineDDL represents the instructions to perform an online schema change via vtctld
func (*OnlineDDL) CachedSize ¶ added in v0.10.0
func (*OnlineDDL) GetFields ¶ added in v0.8.0
func (v *OnlineDDL) GetFields(vcursor VCursor, bindVars map[string]*query.BindVariable) (*sqltypes.Result, error)
GetFields implements the Primitive interface
func (*OnlineDDL) GetKeyspaceName ¶ added in v0.8.0
GetKeyspaceName implements the Primitive interface
func (*OnlineDDL) GetTableName ¶ added in v0.8.0
GetTableName implements the Primitive interface
func (OnlineDDL) Inputs ¶ added in v0.8.0
func (OnlineDDL) Inputs() []Primitive
Inputs implements no inputs
func (OnlineDDL) NeedsTransaction ¶ added in v0.8.0
func (OnlineDDL) NeedsTransaction() bool
type OrderByParams ¶ added in v0.12.0
type OrderByParams struct { Col int // WeightStringCol is the weight_string column that will be used for sorting. // It is set to -1 if such a column is not added to the query WeightStringCol int Desc bool StarColFixedIndex int // v3 specific boolean. Used to also add weight strings originating from GroupBys to the Group by clause FromGroupBy bool }
OrderByParams specifies the parameters for ordering. This is used for merge-sorting scatter queries.
func (OrderByParams) String ¶ added in v0.12.0
func (obp OrderByParams) String() string
String returns a string. Used for plan descriptions
type OrderedAggregate ¶
type OrderedAggregate struct { // PreProcess is true if one of the aggregates needs preprocessing. PreProcess bool `json:",omitempty"` // Aggregates specifies the aggregation parameters for each // aggregation function: function opcode and input column number. Aggregates []*AggregateParams // GroupByKeys specifies the input values that must be used for // the aggregation key. GroupByKeys []*GroupByParams // TruncateColumnCount specifies the number of columns to return // in the final result. Rest of the columns are truncated // from the result received. If 0, no truncation happens. TruncateColumnCount int `json:",omitempty"` // Input is the primitive that will feed into this Primitive. Input Primitive }
OrderedAggregate is a primitive that expects the underlying primitive to feed results in an order sorted by the Keys. Rows with duplicate keys are aggregated using the Aggregate functions. The assumption is that the underlying primitive is a scatter select with pre-sorted rows.
func (*OrderedAggregate) CachedSize ¶ added in v0.10.0
func (cached *OrderedAggregate) CachedSize(alloc bool) int64
func (*OrderedAggregate) GetFields ¶
func (oa *OrderedAggregate) GetFields(vcursor VCursor, bindVars map[string]*querypb.BindVariable) (*sqltypes.Result, error)
GetFields is a Primitive function.
func (*OrderedAggregate) GetKeyspaceName ¶
func (oa *OrderedAggregate) GetKeyspaceName() string
GetKeyspaceName specifies the Keyspace that this primitive routes to.
func (*OrderedAggregate) GetTableName ¶
func (oa *OrderedAggregate) GetTableName() string
GetTableName specifies the table that this primitive routes to.
func (*OrderedAggregate) Inputs ¶
func (oa *OrderedAggregate) Inputs() []Primitive
Inputs returns the Primitive input for this aggregation
func (*OrderedAggregate) NeedsTransaction ¶
func (oa *OrderedAggregate) NeedsTransaction() bool
NeedsTransaction implements the Primitive interface
func (*OrderedAggregate) RouteType ¶
func (oa *OrderedAggregate) RouteType() string
RouteType returns a description of the query routing type used by the primitive
func (*OrderedAggregate) SetTruncateColumnCount ¶
func (oa *OrderedAggregate) SetTruncateColumnCount(count int)
SetTruncateColumnCount sets the truncate column count.
func (*OrderedAggregate) TryExecute ¶ added in v0.12.0
func (oa *OrderedAggregate) TryExecute(vcursor VCursor, bindVars map[string]*querypb.BindVariable, wantfields bool) (*sqltypes.Result, error)
TryExecute is a Primitive function.
func (*OrderedAggregate) TryStreamExecute ¶ added in v0.12.0
func (oa *OrderedAggregate) TryStreamExecute(vcursor VCursor, bindVars map[string]*querypb.BindVariable, wantfields bool, callback func(*sqltypes.Result) error) error
TryStreamExecute is a Primitive function.
type Plan ¶
type Plan struct { Type sqlparser.StatementType // The type of query we have Original string // Original is the original query. Instructions Primitive // Instructions contains the instructions needed to fulfil the query. BindVarNeeds *sqlparser.BindVarNeeds // Stores BindVars needed to be provided as part of expression rewriting Warnings []*querypb.QueryWarning // Warnings that need to be yielded every time this query runs ExecCount uint64 // Count of times this plan was executed ExecTime uint64 // Total execution time ShardQueries uint64 // Total number of shard queries RowsReturned uint64 // Total number of rows RowsAffected uint64 // Total number of rows Errors uint64 // Total number of errors }
Plan represents the execution strategy for a given query. For now it's a simple wrapper around the real instructions. An instruction (aka Primitive) is typically a tree where each node does its part by combining the results of the sub-nodes.
func (*Plan) AddStats ¶
func (p *Plan) AddStats(execCount uint64, execTime time.Duration, shardQueries, rowsAffected, rowsReturned, errors uint64)
AddStats updates the plan execution statistics
func (*Plan) CachedSize ¶ added in v0.10.0
func (*Plan) MarshalJSON ¶
MarshalJSON serializes the plan into a JSON representation.
type Primitive ¶
type Primitive interface { RouteType() string GetKeyspaceName() string GetTableName() string GetFields(vcursor VCursor, bindVars map[string]*querypb.BindVariable) (*sqltypes.Result, error) NeedsTransaction() bool TryExecute(vcursor VCursor, bindVars map[string]*querypb.BindVariable, wantfields bool) (*sqltypes.Result, error) TryStreamExecute(vcursor VCursor, bindVars map[string]*querypb.BindVariable, wantfields bool, callback func(*sqltypes.Result) error) error // Inputs is a slice containing the inputs to this Primitive Inputs() []Primitive // contains filtered or unexported methods }
Primitive is the building block of the engine execution plan. They form a tree structure, where the leaves typically issue queries to one or more vttablet. During execution, the Primitive's pass Result objects up the tree structure, until reaching the root, and its result is passed to the client.
type PrimitiveDescription ¶
type PrimitiveDescription struct { OperatorType string Variant string // Keyspace specifies the keyspace to send the query to. Keyspace *vindexes.Keyspace // TargetDestination specifies an explicit target destination to send the query to. TargetDestination key.Destination // TargetTabletType specifies an explicit target destination tablet type // this is only used in conjunction with TargetDestination TargetTabletType topodatapb.TabletType Other map[string]interface{} Inputs []PrimitiveDescription }
PrimitiveDescription is used to create a serializable representation of the Primitive tree Using this structure, all primitives can share json marshalling code, which gives us an uniform output
func PrimitiveToPlanDescription ¶
func PrimitiveToPlanDescription(in Primitive) PrimitiveDescription
PrimitiveToPlanDescription transforms a primitive tree into a corresponding PlanDescription tree
func (PrimitiveDescription) MarshalJSON ¶
func (pd PrimitiveDescription) MarshalJSON() ([]byte, error)
MarshalJSON serializes the PlanDescription into a JSON representation. We do this rather manual thing here so the `other` map looks like fields belonging to pd and not a map in a field.
type Projection ¶
type Projection struct { Cols []string Exprs []evalengine.Expr Input Primitive // contains filtered or unexported fields }
Projection can evaluate expressions and project the results
func (*Projection) CachedSize ¶ added in v0.10.0
func (cached *Projection) CachedSize(alloc bool) int64
func (*Projection) GetFields ¶
func (p *Projection) GetFields(vcursor VCursor, bindVars map[string]*querypb.BindVariable) (*sqltypes.Result, error)
GetFields implements the Primitive interface
func (*Projection) GetKeyspaceName ¶
func (p *Projection) GetKeyspaceName() string
GetKeyspaceName implements the Primitive interface
func (*Projection) GetTableName ¶
func (p *Projection) GetTableName() string
GetTableName implements the Primitive interface
func (*Projection) Inputs ¶
func (p *Projection) Inputs() []Primitive
Inputs implements the Primitive interface
func (Projection) NeedsTransaction ¶
func (Projection) NeedsTransaction() bool
func (*Projection) RouteType ¶
func (p *Projection) RouteType() string
RouteType implements the Primitive interface
func (*Projection) TryExecute ¶ added in v0.12.0
func (p *Projection) TryExecute(vcursor VCursor, bindVars map[string]*querypb.BindVariable, wantfields bool) (*sqltypes.Result, error)
TryExecute implements the Primitive interface
func (*Projection) TryStreamExecute ¶ added in v0.12.0
func (p *Projection) TryStreamExecute(vcursor VCursor, bindVars map[string]*querypb.BindVariable, wantields bool, callback func(*sqltypes.Result) error) error
TryStreamExecute implements the Primitive interface
type PulloutOpcode ¶
type PulloutOpcode int
PulloutOpcode is a number representing the opcode for the PulloutSubquery primitive.
func (PulloutOpcode) MarshalJSON ¶
func (code PulloutOpcode) MarshalJSON() ([]byte, error)
MarshalJSON serializes the PulloutOpcode as a JSON string. It's used for testing and diagnostics.
func (PulloutOpcode) String ¶
func (code PulloutOpcode) String() string
type PulloutSubquery ¶
type PulloutSubquery struct { Opcode PulloutOpcode // SubqueryResult and HasValues are used to send in the bindvar used in the query to the underlying primitive SubqueryResult string HasValues string Subquery Primitive Underlying Primitive }
PulloutSubquery executes a "pulled out" subquery and stores the results in a bind variable.
func (*PulloutSubquery) CachedSize ¶ added in v0.10.0
func (cached *PulloutSubquery) CachedSize(alloc bool) int64
func (*PulloutSubquery) GetFields ¶
func (ps *PulloutSubquery) GetFields(vcursor VCursor, bindVars map[string]*querypb.BindVariable) (*sqltypes.Result, error)
GetFields fetches the field info.
func (*PulloutSubquery) GetKeyspaceName ¶
func (ps *PulloutSubquery) GetKeyspaceName() string
GetKeyspaceName specifies the Keyspace that this primitive routes to.
func (*PulloutSubquery) GetTableName ¶
func (ps *PulloutSubquery) GetTableName() string
GetTableName specifies the table that this primitive routes to.
func (*PulloutSubquery) Inputs ¶
func (ps *PulloutSubquery) Inputs() []Primitive
Inputs returns the input primitives for this join
func (*PulloutSubquery) NeedsTransaction ¶
func (ps *PulloutSubquery) NeedsTransaction() bool
NeedsTransaction implements the Primitive interface
func (*PulloutSubquery) RouteType ¶
func (ps *PulloutSubquery) RouteType() string
RouteType returns a description of the query routing type used by the primitive
func (*PulloutSubquery) TryExecute ¶ added in v0.12.0
func (ps *PulloutSubquery) TryExecute(vcursor VCursor, bindVars map[string]*querypb.BindVariable, wantfields bool) (*sqltypes.Result, error)
TryExecute satisfies the Primitive interface.
func (*PulloutSubquery) TryStreamExecute ¶ added in v0.12.0
func (ps *PulloutSubquery) TryStreamExecute(vcursor VCursor, bindVars map[string]*querypb.BindVariable, wantfields bool, callback func(*sqltypes.Result) error) error
TryStreamExecute performs a streaming exec.
type RenameFields ¶ added in v0.10.0
type RenameFields struct { Cols []string Indices []int Input Primitive // contains filtered or unexported fields }
RenameFields is a primitive that renames the fields
func NewRenameField ¶ added in v0.10.0
func NewRenameField(cols []string, indices []int, input Primitive) (*RenameFields, error)
NewRenameField creates a new rename field
func (*RenameFields) CachedSize ¶ added in v0.10.0
func (cached *RenameFields) CachedSize(alloc bool) int64
func (*RenameFields) GetFields ¶ added in v0.10.0
func (r *RenameFields) GetFields(vcursor VCursor, bindVars map[string]*querypb.BindVariable) (*sqltypes.Result, error)
GetFields implements the primitive interface
func (*RenameFields) GetKeyspaceName ¶ added in v0.10.0
func (r *RenameFields) GetKeyspaceName() string
GetKeyspaceName implements the primitive interface
func (*RenameFields) GetTableName ¶ added in v0.10.0
func (r *RenameFields) GetTableName() string
GetTableName implements the primitive interface
func (*RenameFields) Inputs ¶ added in v0.10.0
func (r *RenameFields) Inputs() []Primitive
Inputs implements the primitive interface
func (RenameFields) NeedsTransaction ¶ added in v0.10.0
func (RenameFields) NeedsTransaction() bool
func (*RenameFields) RouteType ¶ added in v0.10.0
func (r *RenameFields) RouteType() string
RouteType implements the primitive interface
func (*RenameFields) TryExecute ¶ added in v0.12.0
func (r *RenameFields) TryExecute(vcursor VCursor, bindVars map[string]*querypb.BindVariable, wantfields bool) (*sqltypes.Result, error)
TryExecute implements the Primitive interface
func (*RenameFields) TryStreamExecute ¶ added in v0.12.0
func (r *RenameFields) TryStreamExecute(vcursor VCursor, bindVars map[string]*querypb.BindVariable, wantfields bool, callback func(*sqltypes.Result) error) error
TryStreamExecute implements the Primitive interface
type ReplaceVariables ¶ added in v0.10.0
type ReplaceVariables struct { Input Primitive // contains filtered or unexported fields }
ReplaceVariables is used in SHOW VARIABLES statements so that it replaces the values for vitess-aware variables
func NewReplaceVariables ¶ added in v0.10.0
func NewReplaceVariables(input Primitive) *ReplaceVariables
NewReplaceVariables is used to create a new ReplaceVariables primitive
func (*ReplaceVariables) CachedSize ¶ added in v0.10.0
func (cached *ReplaceVariables) CachedSize(alloc bool) int64
func (*ReplaceVariables) GetFields ¶ added in v0.10.0
func (r *ReplaceVariables) GetFields(vcursor VCursor, bindVars map[string]*querypb.BindVariable) (*sqltypes.Result, error)
GetFields implements the Primitive interface
func (*ReplaceVariables) GetKeyspaceName ¶ added in v0.10.0
func (r *ReplaceVariables) GetKeyspaceName() string
GetKeyspaceName implements the Primitive interface
func (*ReplaceVariables) GetTableName ¶ added in v0.10.0
func (r *ReplaceVariables) GetTableName() string
GetTableName implements the Primitive interface
func (*ReplaceVariables) Inputs ¶ added in v0.10.0
func (r *ReplaceVariables) Inputs() []Primitive
Inputs implements the Primitive interface
func (ReplaceVariables) NeedsTransaction ¶ added in v0.10.0
func (ReplaceVariables) NeedsTransaction() bool
func (*ReplaceVariables) RouteType ¶ added in v0.10.0
func (r *ReplaceVariables) RouteType() string
RouteType implements the Primitive interface
func (*ReplaceVariables) TryExecute ¶ added in v0.12.0
func (r *ReplaceVariables) TryExecute(vcursor VCursor, bindVars map[string]*querypb.BindVariable, wantfields bool) (*sqltypes.Result, error)
TryExecute implements the Primitive interface
func (*ReplaceVariables) TryStreamExecute ¶ added in v0.12.0
func (r *ReplaceVariables) TryStreamExecute(vcursor VCursor, bindVars map[string]*querypb.BindVariable, wantfields bool, callback func(*sqltypes.Result) error) error
TryStreamExecute implements the Primitive interface
type RevertMigration ¶ added in v0.10.0
type RevertMigration struct { Keyspace *vindexes.Keyspace Stmt *sqlparser.RevertMigration Query string TargetDestination key.Destination // contains filtered or unexported fields }
RevertMigration represents the instructions to perform an online schema change via vtctld
func (*RevertMigration) CachedSize ¶ added in v0.10.0
func (cached *RevertMigration) CachedSize(alloc bool) int64
func (*RevertMigration) GetFields ¶ added in v0.10.0
func (v *RevertMigration) GetFields(vcursor VCursor, bindVars map[string]*query.BindVariable) (*sqltypes.Result, error)
GetFields implements the Primitive interface
func (*RevertMigration) GetKeyspaceName ¶ added in v0.10.0
func (v *RevertMigration) GetKeyspaceName() string
GetKeyspaceName implements the Primitive interface
func (*RevertMigration) GetTableName ¶ added in v0.10.0
func (v *RevertMigration) GetTableName() string
GetTableName implements the Primitive interface
func (RevertMigration) Inputs ¶ added in v0.10.0
func (RevertMigration) Inputs() []Primitive
Inputs implements no inputs
func (RevertMigration) NeedsTransaction ¶ added in v0.10.0
func (RevertMigration) NeedsTransaction() bool
func (*RevertMigration) RouteType ¶ added in v0.10.0
func (v *RevertMigration) RouteType() string
RouteType implements the Primitive interface
func (*RevertMigration) TryExecute ¶ added in v0.12.0
func (v *RevertMigration) TryExecute(vcursor VCursor, bindVars map[string]*query.BindVariable, wantfields bool) (result *sqltypes.Result, err error)
TryExecute implements the Primitive interface
func (*RevertMigration) TryStreamExecute ¶ added in v0.12.0
func (v *RevertMigration) TryStreamExecute(vcursor VCursor, bindVars map[string]*query.BindVariable, wantfields bool, callback func(*sqltypes.Result) error) error
TryStreamExecute implements the Primitive interface
type Route ¶
type Route struct { // the fields are described in the RouteOpcode values comments. // Opcode is the execution opcode. Opcode RouteOpcode // Keyspace specifies the keyspace to send the query to. Keyspace *vindexes.Keyspace // TargetDestination specifies an explicit target destination to send the query to. // This bypases the core of the v3 engine. TargetDestination key.Destination // TargetTabletType specifies an explicit target destination tablet type // this is only used in conjunction with TargetDestination TargetTabletType topodatapb.TabletType // Query specifies the query to be executed. Query string // TableName specifies the table to send the query to. TableName string // FieldQuery specifies the query to be executed for a GetFieldInfo request. FieldQuery string // Vindex specifies the vindex to be used. Vindex vindexes.SingleColumn // Values specifies the vindex values to use for routing. Values []sqltypes.PlanValue // OrderBy specifies the key order for merge sorting. This will be // set only for scatter queries that need the results to be // merge-sorted. OrderBy []OrderByParams // TruncateColumnCount specifies the number of columns to return // in the final result. Rest of the columns are truncated // from the result received. If 0, no truncation happens. TruncateColumnCount int // QueryTimeout contains the optional timeout (in milliseconds) to apply to this query QueryTimeout int // ScatterErrorsAsWarnings is true if results should be returned even if some shards have an error ScatterErrorsAsWarnings bool // The following two fields are used when routing information_schema queries SysTableTableSchema []evalengine.Expr SysTableTableName map[string]evalengine.Expr // contains filtered or unexported fields }
Route represents the instructions to route a read query to one or many vttablets.
func NewRoute ¶
func NewRoute(opcode RouteOpcode, keyspace *vindexes.Keyspace, query, fieldQuery string) *Route
NewRoute creates a Route.
func NewSimpleRoute ¶
func NewSimpleRoute(opcode RouteOpcode, keyspace *vindexes.Keyspace) *Route
NewSimpleRoute creates a Route with the bare minimum of parameters.
func (*Route) CachedSize ¶ added in v0.10.0
func (*Route) GetFields ¶
func (route *Route) GetFields(vcursor VCursor, bindVars map[string]*querypb.BindVariable) (*sqltypes.Result, error)
GetFields fetches the field info.
func (*Route) GetKeyspaceName ¶
GetKeyspaceName specifies the Keyspace that this primitive routes to.
func (*Route) GetTableName ¶
GetTableName specifies the table that this primitive routes to.
func (Route) NeedsTransaction ¶
func (Route) NeedsTransaction() bool
func (*Route) RouteType ¶
RouteType returns a description of the query routing type used by the primitive
func (*Route) SetTruncateColumnCount ¶
SetTruncateColumnCount sets the truncate column count.
type RouteOpcode ¶
type RouteOpcode int
RouteOpcode is a number representing the opcode for the Route primitve.
func (RouteOpcode) MarshalJSON ¶
func (code RouteOpcode) MarshalJSON() ([]byte, error)
MarshalJSON serializes the RouteOpcode as a JSON string. It's used for testing and diagnostics.
func (RouteOpcode) String ¶ added in v0.12.0
func (code RouteOpcode) String() string
String returns a string presentation of this opcode
type Rows ¶
type Rows struct {
// contains filtered or unexported fields
}
Rows simply returns a number or rows
func NewRowsPrimitive ¶
NewRowsPrimitive returns a new Rows primitie
func (*Rows) CachedSize ¶ added in v0.10.0
func (*Rows) GetKeyspaceName ¶
GetKeyspaceName implements the Primitive interface
func (*Rows) GetTableName ¶
GetTableName implements the Primitive interface
func (Rows) NeedsTransaction ¶
func (Rows) NeedsTransaction() bool
type SQLCalcFoundRows ¶ added in v0.8.0
SQLCalcFoundRows is a primitive to execute limit and count query as per their individual plan.
func (*SQLCalcFoundRows) CachedSize ¶ added in v0.10.0
func (cached *SQLCalcFoundRows) CachedSize(alloc bool) int64
func (SQLCalcFoundRows) GetFields ¶ added in v0.8.0
func (s SQLCalcFoundRows) GetFields(vcursor VCursor, bindVars map[string]*querypb.BindVariable) (*sqltypes.Result, error)
GetFields implements the Primitive interface
func (SQLCalcFoundRows) GetKeyspaceName ¶ added in v0.8.0
func (s SQLCalcFoundRows) GetKeyspaceName() string
GetKeyspaceName implements the Primitive interface
func (SQLCalcFoundRows) GetTableName ¶ added in v0.8.0
func (s SQLCalcFoundRows) GetTableName() string
GetTableName implements the Primitive interface
func (SQLCalcFoundRows) Inputs ¶ added in v0.8.0
func (s SQLCalcFoundRows) Inputs() []Primitive
Inputs implements the Primitive interface
func (SQLCalcFoundRows) NeedsTransaction ¶ added in v0.8.0
func (s SQLCalcFoundRows) NeedsTransaction() bool
NeedsTransaction implements the Primitive interface
func (SQLCalcFoundRows) RouteType ¶ added in v0.8.0
func (s SQLCalcFoundRows) RouteType() string
RouteType implements the Primitive interface
func (SQLCalcFoundRows) TryExecute ¶ added in v0.12.0
func (s SQLCalcFoundRows) TryExecute(vcursor VCursor, bindVars map[string]*querypb.BindVariable, wantfields bool) (*sqltypes.Result, error)
TryExecute implements the Primitive interface
func (SQLCalcFoundRows) TryStreamExecute ¶ added in v0.12.0
func (s SQLCalcFoundRows) TryStreamExecute(vcursor VCursor, bindVars map[string]*querypb.BindVariable, wantfields bool, callback func(*sqltypes.Result) error) error
TryStreamExecute implements the Primitive interface
type Send ¶
type Send struct { // Keyspace specifies the keyspace to send the query to. Keyspace *vindexes.Keyspace // TargetDestination specifies an explicit target destination to send the query to. TargetDestination key.Destination // Query specifies the query to be executed. Query string // IsDML specifies how to deal with autocommit behaviour IsDML bool // SingleShardOnly specifies that the query must be send to only single shard SingleShardOnly bool // ShardNameNeeded specified that the shard name is added to the bind variables ShardNameNeeded bool // MultishardAutocommit specifies that a multishard transaction query can autocommit MultishardAutocommit bool // contains filtered or unexported fields }
Send is an operator to send query to the specific keyspace, tabletType and destination
func (*Send) CachedSize ¶ added in v0.10.0
func (*Send) GetFields ¶
func (s *Send) GetFields(vcursor VCursor, bindVars map[string]*querypb.BindVariable) (*sqltypes.Result, error)
GetFields implements Primitive interface
func (*Send) GetKeyspaceName ¶
GetKeyspaceName implements Primitive interface
func (*Send) GetTableName ¶
GetTableName implements Primitive interface
func (*Send) NeedsTransaction ¶
NeedsTransaction implements the Primitive interface
type SessionActions ¶
type SessionActions interface { // RecordWarning stores the given warning in the current session RecordWarning(warning *querypb.QueryWarning) SetTarget(target string) error SetUDV(key string, value interface{}) error SetSysVar(name string, expr string) // NeedsReservedConn marks this session as needing a dedicated connection to underlying database NeedsReservedConn() // InReservedConn provides whether this session is using reserved connection InReservedConn() bool // ShardSession returns shard info about open connections ShardSession() []*srvtopo.ResolvedShard SetAutocommit(bool) error SetClientFoundRows(bool) error SetSkipQueryPlanCache(bool) error SetSQLSelectLimit(int64) error SetTransactionMode(vtgatepb.TransactionMode) SetWorkload(querypb.ExecuteOptions_Workload) SetPlannerVersion(querypb.ExecuteOptions_PlannerVersion) SetFoundRows(uint64) SetDDLStrategy(string) GetDDLStrategy() string GetSessionUUID() string SetSessionEnableSystemSettings(bool) error GetSessionEnableSystemSettings() bool // SetReadAfterWriteGTID sets the GTID that the user expects a replica to have caught up with before answering a query SetReadAfterWriteGTID(string) SetReadAfterWriteTimeout(float64) SetSessionTrackGTIDs(bool) // HasCreatedTempTable will mark the session as having created temp tables HasCreatedTempTable() GetWarnings() []*querypb.QueryWarning }
SessionActions gives primitives ability to interact with the session state
type SessionPrimitive ¶ added in v0.11.0
type SessionPrimitive struct {
// contains filtered or unexported fields
}
SessionPrimitive the session primitive is a very small primitive used when we have simple engine code that needs to interact with the Session
func NewSessionPrimitive ¶ added in v0.11.0
func NewSessionPrimitive(name string, action func(sa SessionActions) (*sqltypes.Result, error)) *SessionPrimitive
NewSessionPrimitive creates a SessionPrimitive
func (*SessionPrimitive) CachedSize ¶ added in v0.11.0
func (cached *SessionPrimitive) CachedSize(alloc bool) int64
func (*SessionPrimitive) GetFields ¶ added in v0.11.0
func (s *SessionPrimitive) GetFields(_ VCursor, _ map[string]*querypb.BindVariable) (*sqltypes.Result, error)
GetFields implements the Primitive interface
func (*SessionPrimitive) GetKeyspaceName ¶ added in v0.11.0
func (s *SessionPrimitive) GetKeyspaceName() string
GetKeyspaceName implements the Primitive interface
func (*SessionPrimitive) GetTableName ¶ added in v0.11.0
func (s *SessionPrimitive) GetTableName() string
GetTableName implements the Primitive interface
func (SessionPrimitive) Inputs ¶ added in v0.11.0
func (SessionPrimitive) Inputs() []Primitive
Inputs implements no inputs
func (SessionPrimitive) NeedsTransaction ¶ added in v0.11.0
func (SessionPrimitive) NeedsTransaction() bool
func (*SessionPrimitive) RouteType ¶ added in v0.11.0
func (s *SessionPrimitive) RouteType() string
RouteType implements the Primitive interface
func (*SessionPrimitive) TryExecute ¶ added in v0.12.0
func (s *SessionPrimitive) TryExecute(vcursor VCursor, _ map[string]*querypb.BindVariable, _ bool) (*sqltypes.Result, error)
TryExecute implements the Primitive interface
func (*SessionPrimitive) TryStreamExecute ¶ added in v0.12.0
func (s *SessionPrimitive) TryStreamExecute(vcursor VCursor, _ map[string]*querypb.BindVariable, _ bool, callback func(*sqltypes.Result) error) error
TryStreamExecute implements the Primitive interface
type Set ¶
Set contains the instructions to perform set.
func (*Set) CachedSize ¶ added in v0.10.0
func (*Set) GetKeyspaceName ¶
GetKeyspaceName implements the Primitive interface method.
func (*Set) GetTableName ¶
GetTableName implements the Primitive interface method.
func (Set) NeedsTransaction ¶
func (Set) NeedsTransaction() bool
type SetOp ¶
type SetOp interface { Execute(vcursor VCursor, env evalengine.ExpressionEnv) error VariableName() string }
SetOp is an interface that different type of set operations implements.
type SimpleProjection ¶ added in v0.12.0
type SimpleProjection struct { // Cols defines the column numbers from the underlying primitive // to be returned. Cols []int Input Primitive }
SimpleProjection selects which columns to keep from the input
func (*SimpleProjection) CachedSize ¶ added in v0.12.0
func (cached *SimpleProjection) CachedSize(alloc bool) int64
func (*SimpleProjection) GetFields ¶ added in v0.12.0
func (sc *SimpleProjection) GetFields(vcursor VCursor, bindVars map[string]*querypb.BindVariable) (*sqltypes.Result, error)
GetFields fetches the field info.
func (*SimpleProjection) GetKeyspaceName ¶ added in v0.12.0
func (sc *SimpleProjection) GetKeyspaceName() string
GetKeyspaceName specifies the Keyspace that this primitive routes to.
func (*SimpleProjection) GetTableName ¶ added in v0.12.0
func (sc *SimpleProjection) GetTableName() string
GetTableName specifies the table that this primitive routes to.
func (*SimpleProjection) Inputs ¶ added in v0.12.0
func (sc *SimpleProjection) Inputs() []Primitive
Inputs returns the input to this primitive
func (*SimpleProjection) NeedsTransaction ¶ added in v0.12.0
func (sc *SimpleProjection) NeedsTransaction() bool
NeedsTransaction implements the Primitive interface
func (*SimpleProjection) RouteType ¶ added in v0.12.0
func (sc *SimpleProjection) RouteType() string
RouteType returns a description of the query routing type used by the primitive
func (*SimpleProjection) TryExecute ¶ added in v0.12.0
func (sc *SimpleProjection) TryExecute(vcursor VCursor, bindVars map[string]*querypb.BindVariable, wantfields bool) (*sqltypes.Result, error)
TryExecute performs a non-streaming exec.
func (*SimpleProjection) TryStreamExecute ¶ added in v0.12.0
func (sc *SimpleProjection) TryStreamExecute(vcursor VCursor, bindVars map[string]*querypb.BindVariable, wantfields bool, callback func(*sqltypes.Result) error) error
TryStreamExecute performs a streaming exec.
type SingleRow ¶
type SingleRow struct {
// contains filtered or unexported fields
}
SingleRow defines an empty result
func (*SingleRow) GetFields ¶
func (s *SingleRow) GetFields(_ VCursor, _ map[string]*query.BindVariable) (*sqltypes.Result, error)
GetFields fetches the field info.
func (*SingleRow) GetKeyspaceName ¶
GetKeyspaceName specifies the Keyspace that this primitive routes to.
func (*SingleRow) GetTableName ¶
GetTableName specifies the table that this primitive routes to.
func (SingleRow) NeedsTransaction ¶
func (SingleRow) NeedsTransaction() bool
func (*SingleRow) RouteType ¶
RouteType returns a description of the query routing type used by the primitive
type StreamExecutor ¶
type StreamExecutor interface {
StreamExecute(vcursor VCursor, bindVars map[string]*querypb.BindVariable, wantields bool, callback func(*sqltypes.Result) error) error
}
StreamExecutor is a subset of Primitive that MergeSort requires its inputs to satisfy.
type SysVarCheckAndIgnore ¶
type SysVarCheckAndIgnore struct { Name string Keyspace *vindexes.Keyspace TargetDestination key.Destination `json:",omitempty"` Expr string }
SysVarCheckAndIgnore implements the SetOp interface to check underlying setting and ignore if same.
func (*SysVarCheckAndIgnore) CachedSize ¶ added in v0.10.0
func (cached *SysVarCheckAndIgnore) CachedSize(alloc bool) int64
func (*SysVarCheckAndIgnore) Execute ¶
func (svci *SysVarCheckAndIgnore) Execute(vcursor VCursor, env evalengine.ExpressionEnv) error
Execute implements the SetOp interface method
func (*SysVarCheckAndIgnore) MarshalJSON ¶
func (svci *SysVarCheckAndIgnore) MarshalJSON() ([]byte, error)
MarshalJSON provides the type to SetOp for plan json
func (*SysVarCheckAndIgnore) VariableName ¶
func (svci *SysVarCheckAndIgnore) VariableName() string
VariableName implements the SetOp interface method
type SysVarIgnore ¶
SysVarIgnore implements the SetOp interface to ignore the settings.
func (*SysVarIgnore) CachedSize ¶ added in v0.10.0
func (cached *SysVarIgnore) CachedSize(alloc bool) int64
func (*SysVarIgnore) Execute ¶
func (svi *SysVarIgnore) Execute(VCursor, evalengine.ExpressionEnv) error
Execute implements the SetOp interface method.
func (*SysVarIgnore) MarshalJSON ¶
func (svi *SysVarIgnore) MarshalJSON() ([]byte, error)
MarshalJSON provides the type to SetOp for plan json
func (*SysVarIgnore) VariableName ¶
func (svi *SysVarIgnore) VariableName() string
VariableName implements the SetOp interface method.
type SysVarReservedConn ¶ added in v0.8.0
type SysVarReservedConn struct { Name string Keyspace *vindexes.Keyspace TargetDestination key.Destination `json:",omitempty"` Expr string }
SysVarReservedConn implements the SetOp interface and will write the changes variable into the session
func (*SysVarReservedConn) CachedSize ¶ added in v0.10.0
func (cached *SysVarReservedConn) CachedSize(alloc bool) int64
func (*SysVarReservedConn) Execute ¶ added in v0.8.0
func (svs *SysVarReservedConn) Execute(vcursor VCursor, env evalengine.ExpressionEnv) error
Execute implements the SetOp interface method
func (*SysVarReservedConn) MarshalJSON ¶ added in v0.8.0
func (svs *SysVarReservedConn) MarshalJSON() ([]byte, error)
MarshalJSON provides the type to SetOp for plan json
func (*SysVarReservedConn) VariableName ¶ added in v0.8.0
func (svs *SysVarReservedConn) VariableName() string
VariableName implements the SetOp interface method
type SysVarSetAware ¶ added in v0.8.0
type SysVarSetAware struct { Name string Expr evalengine.Expr }
SysVarSetAware implements the SetOp interface and will write the changes variable into the session The special part is that these settings change the sessions behaviour in different ways
func (*SysVarSetAware) CachedSize ¶ added in v0.10.0
func (cached *SysVarSetAware) CachedSize(alloc bool) int64
func (*SysVarSetAware) Execute ¶ added in v0.8.0
func (svss *SysVarSetAware) Execute(vcursor VCursor, env evalengine.ExpressionEnv) error
Execute implements the SetOp interface method
func (*SysVarSetAware) MarshalJSON ¶ added in v0.8.0
func (svss *SysVarSetAware) MarshalJSON() ([]byte, error)
MarshalJSON marshals all the json
func (*SysVarSetAware) VariableName ¶ added in v0.8.0
func (svss *SysVarSetAware) VariableName() string
VariableName implements the SetOp interface method
type Update ¶
type Update struct { DML // ChangedVindexValues contains values for updated Vindexes during an update statement. ChangedVindexValues map[string]*VindexValues // contains filtered or unexported fields }
Update represents the instructions to perform an update.
func (*Update) CachedSize ¶ added in v0.10.0
func (*Update) GetFields ¶
func (upd *Update) GetFields(vcursor VCursor, bindVars map[string]*querypb.BindVariable) (*sqltypes.Result, error)
GetFields fetches the field info.
func (*Update) GetKeyspaceName ¶
GetKeyspaceName specifies the Keyspace that this primitive routes to.
func (*Update) GetTableName ¶
GetTableName specifies the table that this primitive routes to.
func (Update) NeedsTransaction ¶
func (Update) NeedsTransaction() bool
func (*Update) RouteType ¶
RouteType returns a description of the query routing type used by the primitive
type UpdateTarget ¶
type UpdateTarget struct { // Target string to be updated Target string // contains filtered or unexported fields }
UpdateTarget is an operator to update target string.
func (*UpdateTarget) CachedSize ¶ added in v0.10.0
func (cached *UpdateTarget) CachedSize(alloc bool) int64
func (*UpdateTarget) GetFields ¶
func (updTarget *UpdateTarget) GetFields(vcursor VCursor, bindVars map[string]*query.BindVariable) (*sqltypes.Result, error)
GetFields implements the Primitive interface
func (*UpdateTarget) GetKeyspaceName ¶
func (updTarget *UpdateTarget) GetKeyspaceName() string
GetKeyspaceName implements the Primitive interface
func (*UpdateTarget) GetTableName ¶
func (updTarget *UpdateTarget) GetTableName() string
GetTableName implements the Primitive interface
func (UpdateTarget) NeedsTransaction ¶
func (UpdateTarget) NeedsTransaction() bool
func (*UpdateTarget) RouteType ¶
func (updTarget *UpdateTarget) RouteType() string
RouteType implements the Primitive interface
func (*UpdateTarget) TryExecute ¶ added in v0.12.0
func (updTarget *UpdateTarget) TryExecute(vcursor VCursor, bindVars map[string]*query.BindVariable, wantfields bool) (*sqltypes.Result, error)
TryExecute implements the Primitive interface
func (*UpdateTarget) TryStreamExecute ¶ added in v0.12.0
func (updTarget *UpdateTarget) TryStreamExecute(vcursor VCursor, bindVars map[string]*query.BindVariable, wantfields bool, callback func(*sqltypes.Result) error) error
TryStreamExecute implements the Primitive interface
type UserDefinedVariable ¶
type UserDefinedVariable struct { Name string Expr evalengine.Expr }
UserDefinedVariable implements the SetOp interface to execute user defined variables.
func (*UserDefinedVariable) CachedSize ¶ added in v0.10.0
func (cached *UserDefinedVariable) CachedSize(alloc bool) int64
func (*UserDefinedVariable) Execute ¶
func (u *UserDefinedVariable) Execute(vcursor VCursor, env evalengine.ExpressionEnv) error
Execute implements the SetOp interface method.
func (*UserDefinedVariable) MarshalJSON ¶
func (u *UserDefinedVariable) MarshalJSON() ([]byte, error)
MarshalJSON provides the type to SetOp for plan json
func (*UserDefinedVariable) VariableName ¶
func (u *UserDefinedVariable) VariableName() string
VariableName implements the SetOp interface method.
type VCursor ¶
type VCursor interface { // Context returns the context of the current request. Context() context.Context // CancelContext cancels the highest level context and its children. CancelContext() GetKeyspace() string // MaxMemoryRows returns the maxMemoryRows flag value. MaxMemoryRows() int // ExceedsMaxMemoryRows returns a boolean indicating whether // the maxMemoryRows value has been exceeded. Returns false // if the max memory rows override directive is set to true ExceedsMaxMemoryRows(numRows int) bool // SetContextTimeout updates the context and sets a timeout. SetContextTimeout(timeout time.Duration) context.CancelFunc // ErrorGroupCancellableContext updates context that can be cancelled. ErrorGroupCancellableContext() (*errgroup.Group, func()) // V3 functions. Execute(method string, query string, bindvars map[string]*querypb.BindVariable, rollbackOnError bool, co vtgatepb.CommitOrder) (*sqltypes.Result, error) AutocommitApproval() bool // Primitive functions ExecutePrimitive(primitive Primitive, bindVars map[string]*querypb.BindVariable, wantfields bool) (*sqltypes.Result, error) StreamExecutePrimitive(primitive Primitive, bindVars map[string]*querypb.BindVariable, wantfields bool, callback func(*sqltypes.Result) error) error // Shard-level functions. ExecuteMultiShard(rss []*srvtopo.ResolvedShard, queries []*querypb.BoundQuery, rollbackOnError, canAutocommit bool) (*sqltypes.Result, []error) ExecuteStandalone(query string, bindvars map[string]*querypb.BindVariable, rs *srvtopo.ResolvedShard) (*sqltypes.Result, error) StreamExecuteMulti(query string, rss []*srvtopo.ResolvedShard, bindVars []map[string]*querypb.BindVariable, callback func(reply *sqltypes.Result) error) []error // Keyspace ID level functions. ExecuteKeyspaceID(keyspace string, ksid []byte, query string, bindVars map[string]*querypb.BindVariable, rollbackOnError, autocommit bool) (*sqltypes.Result, error) // Resolver methods, from key.Destination to srvtopo.ResolvedShard. // Will replace all of the Topo functions. ResolveDestinations(keyspace string, ids []*querypb.Value, destinations []key.Destination) ([]*srvtopo.ResolvedShard, [][]*querypb.Value, error) ExecuteVSchema(keyspace string, vschemaDDL *sqlparser.AlterVschema) error SubmitOnlineDDL(onlineDDl *schema.OnlineDDL) error Session() SessionActions ExecuteLock(rs *srvtopo.ResolvedShard, query *querypb.BoundQuery) (*sqltypes.Result, error) InTransactionAndIsDML() bool LookupRowLockShardSession() vtgatepb.CommitOrder FindRoutedTable(tablename sqlparser.TableName) (*vindexes.Table, error) // GetDBDDLPlugin gets the configured plugin for DROP/CREATE DATABASE GetDBDDLPluginName() string // KeyspaceAvailable returns true when a keyspace is visible from vtgate KeyspaceAvailable(ks string) bool MessageStream(rss []*srvtopo.ResolvedShard, tableName string, callback func(*sqltypes.Result) error) error VStream(rss []*srvtopo.ResolvedShard, filter *binlogdatapb.Filter, gtid string, callback func(evs []*binlogdatapb.VEvent) error) error }
VCursor defines the interface the engine will use to execute routes.
type VStream ¶ added in v0.11.0
type VStream struct { Keyspace *vindexes.Keyspace TargetDestination key.Destination TableName string Position string Limit int // contains filtered or unexported fields }
VStream is an operator for streaming specific keyspace, destination
func (*VStream) CachedSize ¶ added in v0.11.0
func (*VStream) GetFields ¶ added in v0.11.0
func (v *VStream) GetFields(_ VCursor, _ map[string]*querypb.BindVariable) (*sqltypes.Result, error)
GetFields implements the Primitive interface
func (*VStream) GetKeyspaceName ¶ added in v0.11.0
GetKeyspaceName implements the Primitive interface
func (*VStream) GetTableName ¶ added in v0.11.0
GetTableName implements the Primitive interface
func (VStream) Inputs ¶ added in v0.11.0
func (VStream) Inputs() []Primitive
Inputs implements no inputs
func (VStream) NeedsTransaction ¶ added in v0.11.0
func (VStream) NeedsTransaction() bool
type VindexFunc ¶
type VindexFunc struct { Opcode VindexOpcode // Fields is the field info for the result. Fields []*querypb.Field // Cols contains source column numbers: 0 for id, 1 for keyspace_id. Cols []int // TODO(sougou): add support for MultiColumn. Vindex vindexes.SingleColumn Value sqltypes.PlanValue // contains filtered or unexported fields }
VindexFunc is a primitive that performs vindex functions.
func (*VindexFunc) CachedSize ¶ added in v0.10.0
func (cached *VindexFunc) CachedSize(alloc bool) int64
func (*VindexFunc) GetFields ¶
func (vf *VindexFunc) GetFields(vcursor VCursor, bindVars map[string]*querypb.BindVariable) (*sqltypes.Result, error)
GetFields fetches the field info.
func (*VindexFunc) GetKeyspaceName ¶
func (vf *VindexFunc) GetKeyspaceName() string
GetKeyspaceName specifies the Keyspace that this primitive routes to.
func (*VindexFunc) GetTableName ¶
func (vf *VindexFunc) GetTableName() string
GetTableName specifies the table that this primitive routes to.
func (VindexFunc) NeedsTransaction ¶
func (VindexFunc) NeedsTransaction() bool
func (*VindexFunc) RouteType ¶
func (vf *VindexFunc) RouteType() string
RouteType returns a description of the query routing type used by the primitive
func (*VindexFunc) TryExecute ¶ added in v0.12.0
func (vf *VindexFunc) TryExecute(vcursor VCursor, bindVars map[string]*querypb.BindVariable, wantfields bool) (*sqltypes.Result, error)
TryExecute performs a non-streaming exec.
func (*VindexFunc) TryStreamExecute ¶ added in v0.12.0
func (vf *VindexFunc) TryStreamExecute(vcursor VCursor, bindVars map[string]*querypb.BindVariable, wantfields bool, callback func(*sqltypes.Result) error) error
TryStreamExecute performs a streaming exec.
type VindexOpcode ¶
type VindexOpcode int
VindexOpcode is the opcode for a VindexFunc.
func (VindexOpcode) MarshalJSON ¶
func (code VindexOpcode) MarshalJSON() ([]byte, error)
MarshalJSON serializes the VindexOpcode into a JSON representation. It's used for testing and diagnostics.
type VindexValues ¶
type VindexValues struct { PvMap map[string]sqltypes.PlanValue Offset int // Offset from ownedVindexQuery to provide input decision for vindex update. }
VindexValues contains changed values for a vindex.
func (*VindexValues) CachedSize ¶ added in v0.10.0
func (cached *VindexValues) CachedSize(alloc bool) int64
Source Files ¶
- cached_size.go
- comparer.go
- concatenate.go
- dbddl.go
- dbddl_plugin.go
- ddl.go
- delete.go
- distinct.go
- dml.go
- gen4_compare_v3.go
- insert.go
- join.go
- limit.go
- lock.go
- memory_sort.go
- merge_sort.go
- mstream.go
- online_ddl.go
- ordered_aggregate.go
- plan_description.go
- primitive.go
- projection.go
- pullout_subquery.go
- rename_fields.go
- replace_variables.go
- revert_migration.go
- route.go
- rows.go
- send.go
- session_primitive.go
- set.go
- shard_route.go
- simple_projection.go
- singlerow.go
- sql_calc_found_rows.go
- update.go
- update_target.go
- vindex_func.go
- vschema_ddl.go
- vstream.go