Documentation
¶
Index ¶
- Constants
- Variables
- func DBDDLRegister(name string, plugin DBDDLPlugin)
- func Exists(m Match, p Primitive) bool
- func GenericJoin(input any, f func(any) string) string
- func GraphViz(p Primitive) (*graphviz.Graph, error)
- func InsertVarName(col sqlparser.IdentifierCI, rowNum int) string
- type AggregateParams
- type AlterVSchema
- func (cached *AlterVSchema) CachedSize(alloc bool) int64
- func (v *AlterVSchema) GetFields(ctx context.Context, vcursor VCursor, bindVars map[string]*query.BindVariable) (*sqltypes.Result, error)
- func (v *AlterVSchema) GetKeyspaceName() string
- func (v *AlterVSchema) GetTableName() string
- func (AlterVSchema) Inputs() ([]Primitive, []map[string]any)
- func (AlterVSchema) NeedsTransaction() bool
- func (v *AlterVSchema) RouteType() string
- func (v *AlterVSchema) TryExecute(ctx context.Context, vcursor VCursor, bindVars map[string]*query.BindVariable, ...) (*sqltypes.Result, error)
- func (v *AlterVSchema) TryStreamExecute(ctx context.Context, vcursor VCursor, bindVars map[string]*query.BindVariable, ...) error
- type CheckCol
- type Concatenate
- func (cached *Concatenate) CachedSize(alloc bool) int64
- func (c *Concatenate) GetFields(ctx context.Context, vcursor VCursor, ...) (*sqltypes.Result, error)
- func (c *Concatenate) GetKeyspaceName() string
- func (c *Concatenate) GetTableName() string
- func (c *Concatenate) Inputs() ([]Primitive, []map[string]any)
- func (c *Concatenate) NeedsTransaction() bool
- func (c *Concatenate) RouteType() string
- func (c *Concatenate) TryExecute(ctx context.Context, vcursor VCursor, ...) (*sqltypes.Result, error)
- func (c *Concatenate) TryStreamExecute(ctx context.Context, vcursor VCursor, ...) error
- type DBDDL
- func (cached *DBDDL) CachedSize(alloc bool) int64
- func (c *DBDDL) GetFields(context.Context, VCursor, map[string]*querypb.BindVariable) (*sqltypes.Result, error)
- func (c *DBDDL) GetKeyspaceName() string
- func (c *DBDDL) GetTableName() string
- func (DBDDL) Inputs() ([]Primitive, []map[string]any)
- func (DBDDL) NeedsTransaction() bool
- func (c *DBDDL) RouteType() string
- func (c *DBDDL) TryExecute(ctx context.Context, vcursor VCursor, ...) (*sqltypes.Result, error)
- func (c *DBDDL) TryStreamExecute(ctx context.Context, vcursor VCursor, ...) error
- type DBDDLPlugin
- type DDL
- func (cached *DDL) CachedSize(alloc bool) int64
- func (ddl *DDL) GetFields(ctx context.Context, vcursor VCursor, bindVars map[string]*query.BindVariable) (*sqltypes.Result, error)
- func (ddl *DDL) GetKeyspaceName() string
- func (ddl *DDL) GetTableName() string
- func (DDL) Inputs() ([]Primitive, []map[string]any)
- func (DDL) NeedsTransaction() bool
- func (ddl *DDL) RouteType() string
- func (ddl *DDL) TryExecute(ctx context.Context, vcursor VCursor, bindVars map[string]*query.BindVariable, ...) (result *sqltypes.Result, err error)
- func (ddl *DDL) TryStreamExecute(ctx context.Context, vcursor VCursor, bindVars map[string]*query.BindVariable, ...) error
- type DML
- type DMLWithInput
- func (cached *DMLWithInput) CachedSize(alloc bool) int64
- func (dml *DMLWithInput) GetFields(context.Context, VCursor, map[string]*querypb.BindVariable) (*sqltypes.Result, error)
- func (dml *DMLWithInput) GetKeyspaceName() string
- func (dml *DMLWithInput) GetTableName() string
- func (dml *DMLWithInput) Inputs() ([]Primitive, []map[string]any)
- func (DMLWithInput) NeedsTransaction() bool
- func (dml *DMLWithInput) RouteType() string
- func (dml *DMLWithInput) TryExecute(ctx context.Context, vcursor VCursor, ...) (*sqltypes.Result, error)
- func (dml *DMLWithInput) TryStreamExecute(ctx context.Context, vcursor VCursor, ...) error
- type Delete
- func (cached *Delete) CachedSize(alloc bool) int64
- func (del *Delete) GetFields(context.Context, VCursor, map[string]*querypb.BindVariable) (*sqltypes.Result, error)
- func (Delete) Inputs() ([]Primitive, []map[string]any)
- func (Delete) NeedsTransaction() bool
- func (del *Delete) TryExecute(ctx context.Context, vcursor VCursor, ...) (*sqltypes.Result, error)
- func (del *Delete) TryStreamExecute(ctx context.Context, vcursor VCursor, ...) error
- type Distinct
- func (cached *Distinct) CachedSize(alloc bool) int64
- func (d *Distinct) GetFields(ctx context.Context, vcursor VCursor, ...) (*sqltypes.Result, error)
- func (d *Distinct) GetKeyspaceName() string
- func (d *Distinct) GetTableName() string
- func (d *Distinct) Inputs() ([]Primitive, []map[string]any)
- func (d *Distinct) NeedsTransaction() bool
- func (d *Distinct) RouteType() string
- func (d *Distinct) TryExecute(ctx context.Context, vcursor VCursor, ...) (*sqltypes.Result, error)
- func (d *Distinct) TryStreamExecute(ctx context.Context, vcursor VCursor, ...) error
- type ExecStmt
- func (cached *ExecStmt) CachedSize(alloc bool) int64
- func (e *ExecStmt) GetFields(ctx context.Context, vcursor VCursor, ...) (*sqltypes.Result, error)
- func (e *ExecStmt) GetKeyspaceName() string
- func (e *ExecStmt) GetTableName() string
- func (e *ExecStmt) Inputs() ([]Primitive, []map[string]any)
- func (e *ExecStmt) NeedsTransaction() bool
- func (e *ExecStmt) RouteType() string
- func (e *ExecStmt) TryExecute(ctx context.Context, vcursor VCursor, ...) (*sqltypes.Result, error)
- func (e *ExecStmt) TryStreamExecute(ctx context.Context, vcursor VCursor, ...) error
- type ExecuteEntry
- type Filter
- func (cached *Filter) CachedSize(alloc bool) int64
- func (f *Filter) GetFields(ctx context.Context, vcursor VCursor, ...) (*sqltypes.Result, error)
- func (f *Filter) GetKeyspaceName() string
- func (f *Filter) GetTableName() string
- func (f *Filter) Inputs() ([]Primitive, []map[string]any)
- func (Filter) NeedsTransaction() bool
- func (f *Filter) RouteType() string
- func (f *Filter) TryExecute(ctx context.Context, vcursor VCursor, ...) (*sqltypes.Result, error)
- func (f *Filter) TryStreamExecute(ctx context.Context, vcursor VCursor, ...) error
- type FkCascade
- func (cached *FkCascade) CachedSize(alloc bool) int64
- func (fkc *FkCascade) GetFields(_ context.Context, _ VCursor, _ map[string]*querypb.BindVariable) (*sqltypes.Result, error)
- func (fkc *FkCascade) GetKeyspaceName() string
- func (fkc *FkCascade) GetTableName() string
- func (fkc *FkCascade) Inputs() ([]Primitive, []map[string]any)
- func (FkCascade) NeedsTransaction() bool
- func (fkc *FkCascade) RouteType() string
- func (fkc *FkCascade) TryExecute(ctx context.Context, vcursor VCursor, ...) (*sqltypes.Result, error)
- func (fkc *FkCascade) TryStreamExecute(ctx context.Context, vcursor VCursor, ...) error
- type FkChild
- type FkVerify
- func (cached *FkVerify) CachedSize(alloc bool) int64
- func (f *FkVerify) GetFields(ctx context.Context, vcursor VCursor, ...) (*sqltypes.Result, error)
- func (f *FkVerify) GetKeyspaceName() string
- func (f *FkVerify) GetTableName() string
- func (f *FkVerify) Inputs() ([]Primitive, []map[string]any)
- func (FkVerify) NeedsTransaction() bool
- func (f *FkVerify) RouteType() string
- func (f *FkVerify) TryExecute(ctx context.Context, vcursor VCursor, ...) (*sqltypes.Result, error)
- func (f *FkVerify) TryStreamExecute(ctx context.Context, vcursor VCursor, ...) error
- type Generate
- type GroupByParams
- type HashJoin
- func (cached *HashJoin) CachedSize(alloc bool) int64
- func (hj *HashJoin) GetFields(ctx context.Context, vcursor VCursor, ...) (*sqltypes.Result, error)
- func (hj *HashJoin) GetKeyspaceName() string
- func (hj *HashJoin) GetTableName() string
- func (hj *HashJoin) Inputs() ([]Primitive, []map[string]any)
- func (hj *HashJoin) NeedsTransaction() bool
- func (hj *HashJoin) RouteType() string
- func (hj *HashJoin) TryExecute(ctx context.Context, vcursor VCursor, ...) (*sqltypes.Result, error)
- func (hj *HashJoin) TryStreamExecute(ctx context.Context, vcursor VCursor, ...) error
- type Insert
- func (cached *Insert) CachedSize(alloc bool) int64
- func (Insert) Inputs() ([]Primitive, []map[string]any)
- func (Insert) NeedsTransaction() bool
- func (ins *Insert) RouteType() string
- func (ins *Insert) TryExecute(ctx context.Context, vcursor VCursor, ...) (*sqltypes.Result, error)
- func (ins *Insert) TryStreamExecute(ctx context.Context, vcursor VCursor, ...) error
- type InsertCommon
- func (cached *InsertCommon) CachedSize(alloc bool) int64
- func (ic *InsertCommon) GetFields(context.Context, VCursor, map[string]*querypb.BindVariable) (*sqltypes.Result, error)
- func (ic *InsertCommon) GetKeyspaceName() string
- func (ic *InsertCommon) GetTableName() string
- func (InsertCommon) NeedsTransaction() bool
- type InsertOpcode
- type InsertSelect
- func (cached *InsertSelect) CachedSize(alloc bool) int64
- func (ins *InsertSelect) Inputs() ([]Primitive, []map[string]any)
- func (InsertSelect) NeedsTransaction() bool
- func (ins *InsertSelect) RouteType() string
- func (ins *InsertSelect) TryExecute(ctx context.Context, vcursor VCursor, ...) (*sqltypes.Result, error)
- func (ins *InsertSelect) TryStreamExecute(ctx context.Context, vcursor VCursor, ...) error
- type Join
- func (cached *Join) CachedSize(alloc bool) int64
- func (jn *Join) GetFields(ctx context.Context, vcursor VCursor, ...) (*sqltypes.Result, error)
- func (jn *Join) GetKeyspaceName() string
- func (jn *Join) GetTableName() string
- func (jn *Join) Inputs() ([]Primitive, []map[string]any)
- func (jn *Join) NeedsTransaction() bool
- func (jn *Join) RouteType() string
- func (jn *Join) TryExecute(ctx context.Context, vcursor VCursor, ...) (*sqltypes.Result, error)
- func (jn *Join) TryStreamExecute(ctx context.Context, vcursor VCursor, ...) error
- type JoinOpcode
- type Limit
- func (cached *Limit) CachedSize(alloc bool) int64
- func (l *Limit) GetFields(ctx context.Context, vcursor VCursor, ...) (*sqltypes.Result, error)
- func (l *Limit) GetKeyspaceName() string
- func (l *Limit) GetTableName() string
- func (l *Limit) Inputs() ([]Primitive, []map[string]any)
- func (l *Limit) NeedsTransaction() bool
- func (l *Limit) RouteType() string
- func (l *Limit) TryExecute(ctx context.Context, vcursor VCursor, ...) (*sqltypes.Result, error)
- func (l *Limit) TryStreamExecute(ctx context.Context, vcursor VCursor, ...) error
- type Lock
- func (cached *Lock) CachedSize(alloc bool) int64
- func (l *Lock) GetFields(ctx context.Context, vcursor VCursor, ...) (*sqltypes.Result, error)
- func (l *Lock) GetKeyspaceName() string
- func (l *Lock) GetTableName() string
- func (Lock) Inputs() ([]Primitive, []map[string]any)
- func (Lock) NeedsTransaction() bool
- func (l *Lock) RouteType() string
- func (l *Lock) TryExecute(ctx context.Context, vcursor VCursor, ...) (*sqltypes.Result, error)
- func (l *Lock) TryStreamExecute(ctx context.Context, vcursor VCursor, ...) error
- type LockFunc
- type MStream
- func (cached *MStream) CachedSize(alloc bool) int64
- func (m *MStream) GetFields(ctx context.Context, vcursor VCursor, ...) (*sqltypes.Result, error)
- func (m *MStream) GetKeyspaceName() string
- func (m *MStream) GetTableName() string
- func (MStream) Inputs() ([]Primitive, []map[string]any)
- func (MStream) NeedsTransaction() bool
- func (m *MStream) RouteType() string
- func (m *MStream) TryExecute(ctx context.Context, vcursor VCursor, ...) (*sqltypes.Result, error)
- func (m *MStream) TryStreamExecute(ctx context.Context, vcursor VCursor, ...) error
- type Match
- type MemorySort
- func (cached *MemorySort) CachedSize(alloc bool) int64
- func (ms *MemorySort) GetFields(ctx context.Context, vcursor VCursor, ...) (*sqltypes.Result, error)
- func (ms *MemorySort) GetKeyspaceName() string
- func (ms *MemorySort) GetTableName() string
- func (ms *MemorySort) Inputs() ([]Primitive, []map[string]any)
- func (ms *MemorySort) NeedsTransaction() bool
- func (ms *MemorySort) RouteType() string
- func (ms *MemorySort) TryExecute(ctx context.Context, vcursor VCursor, ...) (*sqltypes.Result, error)
- func (ms *MemorySort) TryStreamExecute(ctx context.Context, vcursor VCursor, ...) (err error)
- type MergeSort
- func (cached *MergeSort) CachedSize(alloc bool) int64
- func (ms *MergeSort) GetFields(ctx context.Context, vcursor VCursor, ...) (*sqltypes.Result, error)
- func (ms *MergeSort) GetKeyspaceName() string
- func (ms *MergeSort) GetTableName() string
- func (MergeSort) Inputs() ([]Primitive, []map[string]any)
- func (MergeSort) NeedsTransaction() bool
- func (ms *MergeSort) RouteType() string
- func (ms *MergeSort) TryExecute(ctx context.Context, vcursor VCursor, ...) (*sqltypes.Result, error)
- func (ms *MergeSort) TryStreamExecute(ctx context.Context, vcursor VCursor, ...) (err error)
- type NonLiteralUpdateInfo
- type OnlineDDL
- func (cached *OnlineDDL) CachedSize(alloc bool) int64
- func (v *OnlineDDL) GetFields(ctx context.Context, vcursor VCursor, ...) (*sqltypes.Result, error)
- func (v *OnlineDDL) GetKeyspaceName() string
- func (v *OnlineDDL) GetTableName() string
- func (OnlineDDL) Inputs() ([]Primitive, []map[string]any)
- func (OnlineDDL) NeedsTransaction() bool
- func (v *OnlineDDL) RouteType() string
- func (v *OnlineDDL) TryExecute(ctx context.Context, vcursor VCursor, ...) (result *sqltypes.Result, err error)
- func (v *OnlineDDL) TryStreamExecute(ctx context.Context, vcursor VCursor, ...) error
- type Opcode
- type OrderedAggregate
- func (cached *OrderedAggregate) CachedSize(alloc bool) int64
- func (oa *OrderedAggregate) GetFields(ctx context.Context, vcursor VCursor, ...) (*sqltypes.Result, error)
- func (oa *OrderedAggregate) GetKeyspaceName() string
- func (oa *OrderedAggregate) GetTableName() string
- func (oa *OrderedAggregate) Inputs() ([]Primitive, []map[string]any)
- func (oa *OrderedAggregate) NeedsTransaction() bool
- func (oa *OrderedAggregate) RouteType() string
- func (oa *OrderedAggregate) TryExecute(ctx context.Context, vcursor VCursor, ...) (*sqltypes.Result, error)
- func (oa *OrderedAggregate) TryStreamExecute(ctx context.Context, vcursor VCursor, ...) error
- type Plan
- type Primitive
- type PrimitiveDescription
- type Projection
- func (cached *Projection) CachedSize(alloc bool) int64
- func (p *Projection) GetFields(ctx context.Context, vcursor VCursor, ...) (*sqltypes.Result, error)
- func (p *Projection) GetKeyspaceName() string
- func (p *Projection) GetTableName() string
- func (p *Projection) Inputs() ([]Primitive, []map[string]any)
- func (Projection) NeedsTransaction() bool
- func (p *Projection) RouteType() string
- func (p *Projection) TryExecute(ctx context.Context, vcursor VCursor, ...) (*sqltypes.Result, error)
- func (p *Projection) TryStreamExecute(ctx context.Context, vcursor VCursor, ...) error
- type RenameFields
- func (cached *RenameFields) CachedSize(alloc bool) int64
- func (r *RenameFields) GetFields(ctx context.Context, vcursor VCursor, ...) (*sqltypes.Result, error)
- func (r *RenameFields) GetKeyspaceName() string
- func (r *RenameFields) GetTableName() string
- func (r *RenameFields) Inputs() ([]Primitive, []map[string]any)
- func (RenameFields) NeedsTransaction() bool
- func (r *RenameFields) RouteType() string
- func (r *RenameFields) TryExecute(ctx context.Context, vcursor VCursor, ...) (*sqltypes.Result, error)
- func (r *RenameFields) TryStreamExecute(ctx context.Context, vcursor VCursor, ...) error
- type ReplaceVariables
- func (cached *ReplaceVariables) CachedSize(alloc bool) int64
- func (r *ReplaceVariables) GetFields(ctx context.Context, vcursor VCursor, ...) (*sqltypes.Result, error)
- func (r *ReplaceVariables) GetKeyspaceName() string
- func (r *ReplaceVariables) GetTableName() string
- func (r *ReplaceVariables) Inputs() ([]Primitive, []map[string]any)
- func (ReplaceVariables) NeedsTransaction() bool
- func (r *ReplaceVariables) RouteType() string
- func (r *ReplaceVariables) TryExecute(ctx context.Context, vcursor VCursor, ...) (*sqltypes.Result, error)
- func (r *ReplaceVariables) TryStreamExecute(ctx context.Context, vcursor VCursor, ...) error
- type RevertMigration
- func (cached *RevertMigration) CachedSize(alloc bool) int64
- func (v *RevertMigration) GetFields(ctx context.Context, vcursor VCursor, ...) (*sqltypes.Result, error)
- func (v *RevertMigration) GetKeyspaceName() string
- func (v *RevertMigration) GetTableName() string
- func (RevertMigration) Inputs() ([]Primitive, []map[string]any)
- func (RevertMigration) NeedsTransaction() bool
- func (v *RevertMigration) RouteType() string
- func (v *RevertMigration) TryExecute(ctx context.Context, vcursor VCursor, ...) (result *sqltypes.Result, err error)
- func (v *RevertMigration) TryStreamExecute(ctx context.Context, vcursor VCursor, ...) error
- type Route
- func (cached *Route) CachedSize(alloc bool) int64
- func (route *Route) GetFields(ctx context.Context, vcursor VCursor, ...) (*sqltypes.Result, error)
- func (route *Route) GetKeyspaceName() string
- func (route *Route) GetTableName() string
- func (Route) Inputs() ([]Primitive, []map[string]any)
- func (Route) NeedsTransaction() bool
- func (route *Route) RouteType() string
- func (route *Route) TryExecute(ctx context.Context, vcursor VCursor, ...) (*sqltypes.Result, error)
- func (route *Route) TryStreamExecute(ctx context.Context, vcursor VCursor, ...) error
- type RoutingParameters
- type Rows
- func (cached *Rows) CachedSize(alloc bool) int64
- func (r *Rows) GetFields(context.Context, VCursor, map[string]*querypb.BindVariable) (*sqltypes.Result, error)
- func (r *Rows) GetKeyspaceName() string
- func (r *Rows) GetTableName() string
- func (Rows) Inputs() ([]Primitive, []map[string]any)
- func (Rows) NeedsTransaction() bool
- func (r *Rows) RouteType() string
- func (r *Rows) TryExecute(context.Context, VCursor, map[string]*querypb.BindVariable, bool) (*sqltypes.Result, error)
- func (r *Rows) TryStreamExecute(ctx context.Context, vcursor VCursor, ...) error
- type SQLCalcFoundRows
- func (cached *SQLCalcFoundRows) CachedSize(alloc bool) int64
- func (s *SQLCalcFoundRows) GetFields(ctx context.Context, vcursor VCursor, ...) (*sqltypes.Result, error)
- func (s *SQLCalcFoundRows) GetKeyspaceName() string
- func (s *SQLCalcFoundRows) GetTableName() string
- func (s *SQLCalcFoundRows) Inputs() ([]Primitive, []map[string]any)
- func (s *SQLCalcFoundRows) NeedsTransaction() bool
- func (s *SQLCalcFoundRows) RouteType() string
- func (s *SQLCalcFoundRows) TryExecute(ctx context.Context, vcursor VCursor, ...) (*sqltypes.Result, error)
- func (s *SQLCalcFoundRows) TryStreamExecute(ctx context.Context, vcursor VCursor, ...) error
- type ScalarAggregate
- func (cached *ScalarAggregate) CachedSize(alloc bool) int64
- func (sa *ScalarAggregate) GetFields(ctx context.Context, vcursor VCursor, ...) (*sqltypes.Result, error)
- func (sa *ScalarAggregate) GetKeyspaceName() string
- func (sa *ScalarAggregate) GetTableName() string
- func (sa *ScalarAggregate) Inputs() ([]Primitive, []map[string]any)
- func (sa *ScalarAggregate) NeedsTransaction() bool
- func (sa *ScalarAggregate) RouteType() string
- func (sa *ScalarAggregate) TryExecute(ctx context.Context, vcursor VCursor, ...) (*sqltypes.Result, error)
- func (sa *ScalarAggregate) TryStreamExecute(ctx context.Context, vcursor VCursor, ...) error
- type SemiJoin
- func (cached *SemiJoin) CachedSize(alloc bool) int64
- func (jn *SemiJoin) GetFields(ctx context.Context, vcursor VCursor, ...) (*sqltypes.Result, error)
- func (jn *SemiJoin) GetKeyspaceName() string
- func (jn *SemiJoin) GetTableName() string
- func (jn *SemiJoin) Inputs() ([]Primitive, []map[string]any)
- func (jn *SemiJoin) NeedsTransaction() bool
- func (jn *SemiJoin) RouteType() string
- func (jn *SemiJoin) TryExecute(ctx context.Context, vcursor VCursor, ...) (*sqltypes.Result, error)
- func (jn *SemiJoin) TryStreamExecute(ctx context.Context, vcursor VCursor, ...) error
- type Send
- func (cached *Send) CachedSize(alloc bool) int64
- func (s *Send) GetFields(ctx context.Context, vcursor VCursor, ...) (*sqltypes.Result, error)
- func (s *Send) GetKeyspaceName() string
- func (s *Send) GetTableName() string
- func (Send) Inputs() ([]Primitive, []map[string]any)
- func (s *Send) NeedsTransaction() bool
- func (s *Send) RouteType() string
- func (s *Send) TryExecute(ctx context.Context, vcursor VCursor, ...) (*sqltypes.Result, error)
- func (s *Send) TryStreamExecute(ctx context.Context, vcursor VCursor, ...) error
- type Sequential
- func (cached *Sequential) CachedSize(alloc bool) int64
- func (s *Sequential) GetFields(context.Context, VCursor, map[string]*querypb.BindVariable) (*sqltypes.Result, error)
- func (s *Sequential) GetKeyspaceName() string
- func (s *Sequential) GetTableName() string
- func (s *Sequential) Inputs() ([]Primitive, []map[string]any)
- func (Sequential) NeedsTransaction() bool
- func (s *Sequential) RouteType() string
- func (s *Sequential) TryExecute(ctx context.Context, vcursor VCursor, ...) (*sqltypes.Result, error)
- func (s *Sequential) TryStreamExecute(ctx context.Context, vcursor VCursor, ...) error
- type SessionActions
- type SessionPrimitive
- func (cached *SessionPrimitive) CachedSize(alloc bool) int64
- func (s *SessionPrimitive) GetFields(ctx context.Context, vcursor VCursor, ...) (*sqltypes.Result, error)
- func (s *SessionPrimitive) GetKeyspaceName() string
- func (s *SessionPrimitive) GetTableName() string
- func (SessionPrimitive) Inputs() ([]Primitive, []map[string]any)
- func (SessionPrimitive) NeedsTransaction() bool
- func (s *SessionPrimitive) RouteType() string
- func (s *SessionPrimitive) TryExecute(ctx context.Context, vcursor VCursor, ...) (*sqltypes.Result, error)
- func (s *SessionPrimitive) TryStreamExecute(ctx context.Context, vcursor VCursor, ...) error
- type Set
- func (cached *Set) CachedSize(alloc bool) int64
- func (s *Set) GetFields(context.Context, VCursor, map[string]*querypb.BindVariable) (*sqltypes.Result, error)
- func (s *Set) GetKeyspaceName() string
- func (s *Set) GetTableName() string
- func (s *Set) Inputs() ([]Primitive, []map[string]any)
- func (Set) NeedsTransaction() bool
- func (s *Set) RouteType() string
- func (s *Set) TryExecute(ctx context.Context, vcursor VCursor, ...) (*sqltypes.Result, error)
- func (s *Set) TryStreamExecute(ctx context.Context, vcursor VCursor, ...) error
- type SetOp
- type ShowExec
- func (cached *ShowExec) CachedSize(alloc bool) int64
- func (s *ShowExec) GetFields(ctx context.Context, vcursor VCursor, bindVars map[string]*query.BindVariable) (*sqltypes.Result, error)
- func (s *ShowExec) GetKeyspaceName() string
- func (s *ShowExec) GetTableName() string
- func (ShowExec) Inputs() ([]Primitive, []map[string]any)
- func (ShowExec) NeedsTransaction() bool
- func (s *ShowExec) RouteType() string
- func (s *ShowExec) TryExecute(ctx context.Context, vcursor VCursor, bindVars map[string]*query.BindVariable, ...) (*sqltypes.Result, error)
- func (s *ShowExec) TryStreamExecute(ctx context.Context, vcursor VCursor, bindVars map[string]*query.BindVariable, ...) error
- type SimpleProjection
- func (cached *SimpleProjection) CachedSize(alloc bool) int64
- func (sc *SimpleProjection) GetFields(ctx context.Context, vcursor VCursor, ...) (*sqltypes.Result, error)
- func (sc *SimpleProjection) GetKeyspaceName() string
- func (sc *SimpleProjection) GetTableName() string
- func (sc *SimpleProjection) Inputs() ([]Primitive, []map[string]any)
- func (sc *SimpleProjection) NeedsTransaction() bool
- func (sc *SimpleProjection) RouteType() string
- func (sc *SimpleProjection) TryExecute(ctx context.Context, vcursor VCursor, ...) (*sqltypes.Result, error)
- func (sc *SimpleProjection) TryStreamExecute(ctx context.Context, vcursor VCursor, ...) error
- type SingleRow
- func (s *SingleRow) GetFields(ctx context.Context, vcursor VCursor, ...) (*sqltypes.Result, error)
- func (s *SingleRow) GetKeyspaceName() string
- func (s *SingleRow) GetTableName() string
- func (SingleRow) Inputs() ([]Primitive, []map[string]any)
- func (SingleRow) NeedsTransaction() bool
- func (s *SingleRow) RouteType() string
- func (s *SingleRow) TryExecute(context.Context, VCursor, map[string]*querypb.BindVariable, bool) (*sqltypes.Result, error)
- func (s *SingleRow) TryStreamExecute(ctx context.Context, vcursor VCursor, ...) error
- type StreamExecutor
- type SysVarCheckAndIgnore
- func (cached *SysVarCheckAndIgnore) CachedSize(alloc bool) int64
- func (svci *SysVarCheckAndIgnore) Execute(ctx context.Context, vcursor VCursor, env *evalengine.ExpressionEnv) error
- func (svci *SysVarCheckAndIgnore) MarshalJSON() ([]byte, error)
- func (svci *SysVarCheckAndIgnore) VariableName() string
- type SysVarIgnore
- type SysVarReservedConn
- type SysVarSetAware
- type ThrottleApp
- func (cached *ThrottleApp) CachedSize(alloc bool) int64
- func (v *ThrottleApp) GetFields(ctx context.Context, vcursor VCursor, ...) (*sqltypes.Result, error)
- func (v *ThrottleApp) GetKeyspaceName() string
- func (v *ThrottleApp) GetTableName() string
- func (ThrottleApp) Inputs() ([]Primitive, []map[string]any)
- func (ThrottleApp) NeedsTransaction() bool
- func (v *ThrottleApp) RouteType() string
- func (v *ThrottleApp) TryExecute(ctx context.Context, vcursor VCursor, ...) (result *sqltypes.Result, err error)
- func (v *ThrottleApp) TryStreamExecute(ctx context.Context, vcursor VCursor, ...) error
- type UncorrelatedSubquery
- func (cached *UncorrelatedSubquery) CachedSize(alloc bool) int64
- func (ps *UncorrelatedSubquery) GetFields(ctx context.Context, vcursor VCursor, ...) (*sqltypes.Result, error)
- func (ps *UncorrelatedSubquery) GetKeyspaceName() string
- func (ps *UncorrelatedSubquery) GetTableName() string
- func (ps *UncorrelatedSubquery) Inputs() ([]Primitive, []map[string]any)
- func (ps *UncorrelatedSubquery) NeedsTransaction() bool
- func (ps *UncorrelatedSubquery) RouteType() string
- func (ps *UncorrelatedSubquery) TryExecute(ctx context.Context, vcursor VCursor, ...) (*sqltypes.Result, error)
- func (ps *UncorrelatedSubquery) TryStreamExecute(ctx context.Context, vcursor VCursor, ...) error
- type Unlock
- func (u *Unlock) GetFields(ctx context.Context, vcursor VCursor, ...) (*sqltypes.Result, error)
- func (u *Unlock) GetKeyspaceName() string
- func (u *Unlock) GetTableName() string
- func (Unlock) Inputs() ([]Primitive, []map[string]any)
- func (Unlock) NeedsTransaction() bool
- func (u *Unlock) RouteType() string
- func (u *Unlock) TryExecute(ctx context.Context, vcursor VCursor, ...) (*sqltypes.Result, error)
- func (u *Unlock) TryStreamExecute(ctx context.Context, vcursor VCursor, ...) error
- type Update
- func (cached *Update) CachedSize(alloc bool) int64
- func (upd *Update) GetFields(ctx context.Context, vcursor VCursor, ...) (*sqltypes.Result, error)
- func (Update) Inputs() ([]Primitive, []map[string]any)
- func (Update) NeedsTransaction() bool
- func (upd *Update) TryExecute(ctx context.Context, vcursor VCursor, ...) (*sqltypes.Result, error)
- func (upd *Update) TryStreamExecute(ctx context.Context, vcursor VCursor, ...) error
- type UpdateTarget
- func (cached *UpdateTarget) CachedSize(alloc bool) int64
- func (updTarget *UpdateTarget) GetFields(ctx context.Context, vcursor VCursor, bindVars map[string]*query.BindVariable) (*sqltypes.Result, error)
- func (updTarget *UpdateTarget) GetKeyspaceName() string
- func (updTarget *UpdateTarget) GetTableName() string
- func (UpdateTarget) Inputs() ([]Primitive, []map[string]any)
- func (UpdateTarget) NeedsTransaction() bool
- func (updTarget *UpdateTarget) RouteType() string
- func (updTarget *UpdateTarget) TryExecute(ctx context.Context, vcursor VCursor, bindVars map[string]*query.BindVariable, ...) (*sqltypes.Result, error)
- func (updTarget *UpdateTarget) TryStreamExecute(ctx context.Context, vcursor VCursor, bindVars map[string]*query.BindVariable, ...) error
- type Upsert
- func (u *Upsert) AddUpsert(ins, upd Primitive)
- func (cached *Upsert) CachedSize(alloc bool) int64
- func (u *Upsert) GetFields(ctx context.Context, vcursor VCursor, ...) (*sqltypes.Result, error)
- func (u *Upsert) GetKeyspaceName() string
- func (u *Upsert) GetTableName() string
- func (u *Upsert) Inputs() ([]Primitive, []map[string]any)
- func (Upsert) NeedsTransaction() bool
- func (u *Upsert) RouteType() string
- func (u *Upsert) TryExecute(ctx context.Context, vcursor VCursor, ...) (*sqltypes.Result, error)
- func (u *Upsert) TryStreamExecute(ctx context.Context, vcursor VCursor, ...) error
- type UserDefinedVariable
- type VCursor
- type VExplain
- func (cached *VExplain) CachedSize(alloc bool) int64
- func (v *VExplain) GetFields(ctx context.Context, vcursor VCursor, ...) (*sqltypes.Result, error)
- func (v *VExplain) GetKeyspaceName() string
- func (v *VExplain) GetTableName() string
- func (v *VExplain) Inputs() ([]Primitive, []map[string]any)
- func (v *VExplain) NeedsTransaction() bool
- func (v *VExplain) RouteType() string
- func (v *VExplain) TryExecute(ctx context.Context, vcursor VCursor, ...) (*sqltypes.Result, error)
- func (v *VExplain) TryStreamExecute(ctx context.Context, vcursor VCursor, ...) error
- type VStream
- func (cached *VStream) CachedSize(alloc bool) int64
- func (v *VStream) GetFields(ctx context.Context, vcursor VCursor, ...) (*sqltypes.Result, error)
- func (v *VStream) GetKeyspaceName() string
- func (v *VStream) GetTableName() string
- func (VStream) Inputs() ([]Primitive, []map[string]any)
- func (VStream) NeedsTransaction() bool
- func (v *VStream) RouteType() string
- func (v *VStream) TryExecute(ctx context.Context, vcursor VCursor, ...) (*sqltypes.Result, error)
- func (v *VStream) TryStreamExecute(ctx context.Context, vcursor VCursor, ...) error
- type Verify
- type VindexFunc
- func (cached *VindexFunc) CachedSize(alloc bool) int64
- func (vf *VindexFunc) GetFields(ctx context.Context, vcursor VCursor, ...) (*sqltypes.Result, error)
- func (vf *VindexFunc) GetKeyspaceName() string
- func (vf *VindexFunc) GetTableName() string
- func (VindexFunc) Inputs() ([]Primitive, []map[string]any)
- func (VindexFunc) NeedsTransaction() bool
- func (vf *VindexFunc) RouteType() string
- func (vf *VindexFunc) TryExecute(ctx context.Context, vcursor VCursor, ...) (*sqltypes.Result, error)
- func (vf *VindexFunc) TryStreamExecute(ctx context.Context, vcursor VCursor, ...) error
- type VindexLookup
- func (cached *VindexLookup) CachedSize(alloc bool) int64
- func (vr *VindexLookup) GetFields(ctx context.Context, vcursor VCursor, ...) (*sqltypes.Result, error)
- func (vr *VindexLookup) GetKeyspaceName() string
- func (vr *VindexLookup) GetTableName() string
- func (vr *VindexLookup) Inputs() ([]Primitive, []map[string]any)
- func (vr *VindexLookup) NeedsTransaction() bool
- func (vr *VindexLookup) RouteType() string
- func (vr *VindexLookup) TryExecute(ctx context.Context, vcursor VCursor, ...) (*sqltypes.Result, error)
- func (vr *VindexLookup) TryStreamExecute(ctx context.Context, vcursor VCursor, ...) error
- type VindexOpcode
- type VindexValues
- type VitessMetadata
Constants ¶
const ( ParentVerify = "VerifyParent" ChildVerify = "VerifyChild" )
constants for verification type.
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 )
const ( InnerJoin = JoinOpcode(iota) LeftJoin )
This is the list of JoinOpcode values.
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 ( // Unsharded is for routing a statement // to an unsharded keyspace. Unsharded = Opcode(iota) // EqualUnique is for routing a query to a single shard. // Requires: A Unique Vindex, and a single Value. EqualUnique // Equal is for routing a query using a non-unique vindex. // Requires: A Vindex, and a single Value. Equal // IN is for routing a statement to a multi shard. // Requires: A Vindex, and a multi Values. IN // MultiEqual is used for routing queries with IN with tuple clause // Requires: A Vindex, and a multi Tuple Values. MultiEqual // SubShard is for when we are missing one or more columns from a composite vindex SubShard // Scatter is for routing a scattered statement. Scatter // Next is for fetching from a sequence. Next // DBA is used for routing DBA queries // e.g: Select * from information_schema.tables where schema_name = "a" DBA // Reference is for fetching from a reference table. Reference // None is used for queries which do not need routing None // 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 Opcode values.
const ( VindexNone = VindexOpcode(iota) VindexMap NumVindexCodes )
These are opcode values for VindexFunc.
const ( RowChangeInsert string = "+" RowChangeDelete string = "-" RowChangeUpdate string = "*" )
for demo purposes we prefix the row with a column with a single char +/*/- to indicate why the row changed + => insert, - => delete, * => update. This will be removed/improved as we iterate over this functionality
const DmlVals = "dml_vals"
const (
IgnoreReserveTxn cxtKey = iota
)
const ShardName = "__vt_shard"
ShardName as key for setting shard name in bind variables map
Variables ¶
var UpperLimitStr = "__upper_limit"
Functions ¶
func DBDDLRegister ¶
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
func InsertVarName ¶
func InsertVarName(col sqlparser.IdentifierCI, rowNum int) string
InsertVarName returns a name for the bind var for this column. This method is used by the planner and engine, to make sure they both produce the same names
Types ¶
type AggregateParams ¶
type AggregateParams struct { Opcode AggregateOpcode Col int // These are used only for distinct opcodes. KeyCol int WCol int Type evalengine.Type Alias string `json:",omitempty"` Expr sqlparser.Expr Original *sqlparser.AliasedExpr // This is based on the function passed in the select expression and // not what we use to aggregate at the engine primitive level. OrigOpcode AggregateOpcode CollationEnv *collations.Environment }
AggregateParams specify the parameters for each aggregation. It contains the opcode and input column number.
func NewAggregateParam ¶
func NewAggregateParam(opcode AggregateOpcode, col int, alias string, collationEnv *collations.Environment) *AggregateParams
func (*AggregateParams) CachedSize ¶
func (cached *AggregateParams) CachedSize(alloc bool) int64
func (*AggregateParams) String ¶
func (ap *AggregateParams) String() string
func (*AggregateParams) WAssigned ¶
func (ap *AggregateParams) WAssigned() bool
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 ¶
func (cached *AlterVSchema) CachedSize(alloc bool) int64
func (*AlterVSchema) GetFields ¶
func (v *AlterVSchema) GetFields(ctx context.Context, 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 ¶
func (v *AlterVSchema) TryExecute(ctx context.Context, vcursor VCursor, bindVars map[string]*query.BindVariable, wantfields bool) (*sqltypes.Result, error)
TryExecute implements the Primitive interface
func (*AlterVSchema) TryStreamExecute ¶
func (v *AlterVSchema) TryStreamExecute(ctx context.Context, vcursor VCursor, bindVars map[string]*query.BindVariable, wantfields bool, callback func(*sqltypes.Result) error) error
TryStreamExecute implements the Primitive interface
type CheckCol ¶
type CheckCol struct { Col int WsCol *int Type evalengine.Type CollationEnv *collations.Environment }
func (*CheckCol) CachedSize ¶
func (CheckCol) SwitchToWeightString ¶
SwitchToWeightString returns a new CheckCol that works on the weight string column instead
type Concatenate ¶
type Concatenate struct { Sources []Primitive // These column offsets do not need to be typed checked - they usually contain weight_string() // columns that are not going to be returned to the user NoNeedToTypeCheck map[int]any }
Concatenate specified the parameter for concatenate primitive
func NewConcatenate ¶
func NewConcatenate(Sources []Primitive, ignoreCols []int) *Concatenate
NewConcatenate creates a Concatenate primitive. The ignoreCols slice contains the offsets that don't need to have the same type between sources - weight_string() sometimes returns VARBINARY and sometimes VARCHAR
func (*Concatenate) CachedSize ¶
func (cached *Concatenate) CachedSize(alloc bool) int64
func (*Concatenate) GetFields ¶
func (c *Concatenate) GetFields(ctx context.Context, 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, []map[string]any)
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 ¶
func (c *Concatenate) TryExecute(ctx context.Context, vcursor VCursor, bindVars map[string]*querypb.BindVariable, _ bool) (*sqltypes.Result, error)
TryExecute performs a non-streaming exec.
func (*Concatenate) TryStreamExecute ¶
func (c *Concatenate) TryStreamExecute(ctx context.Context, vcursor VCursor, bindVars map[string]*querypb.BindVariable, _ bool, callback func(*sqltypes.Result) error) error
TryStreamExecute performs a streaming exec.
type DBDDL ¶
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 ¶
NewDBDDL creates the engine primitive `create` will be true for CREATE, and false for DROP
func (*DBDDL) CachedSize ¶
func (*DBDDL) GetFields ¶
func (c *DBDDL) GetFields(context.Context, VCursor, map[string]*querypb.BindVariable) (*sqltypes.Result, error)
GetFields implements the Primitive interface
func (*DBDDL) GetKeyspaceName ¶
GetKeyspaceName implements the Primitive interface
func (*DBDDL) GetTableName ¶
GetTableName implements the Primitive interface
func (DBDDL) NeedsTransaction ¶
func (DBDDL) NeedsTransaction() bool
type DBDDLPlugin ¶
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 ¶
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 ¶
func (*DDL) GetFields ¶
func (ddl *DDL) GetFields(ctx context.Context, vcursor VCursor, bindVars map[string]*query.BindVariable) (*sqltypes.Result, error)
GetFields implements the Primitive interface
func (*DDL) GetKeyspaceName ¶
GetKeyspaceName implements the Primitive interface
func (*DDL) GetTableName ¶
GetTableName implements the Primitive interface
func (DDL) NeedsTransaction ¶
func (DDL) NeedsTransaction() bool
type DML ¶
type DML struct { // Query specifies the query to be executed. Query string // KsidVindex is primary Vindex KsidVindex vindexes.Vindex // KsidLength is number of columns that represents KsidVindex KsidLength int // TableNames are the name of the tables involved in the query. TableNames []string // Vindexes are the column vindexes modified by this DML. Vindexes []*vindexes.ColumnVindex // 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 PreventAutoCommit bool // RoutingParameters parameters required for query routing. *RoutingParameters // contains filtered or unexported fields }
DML contains the common elements between Update and Delete plans
func (*DML) CachedSize ¶
func (*DML) GetKeyspaceName ¶
GetKeyspaceName specifies the Keyspace that this primitive routes to.
func (*DML) GetTableName ¶
GetTableName specifies the table that this primitive routes to.
func (DML) NeedsTransaction ¶
func (DML) NeedsTransaction() bool
type DMLWithInput ¶
type DMLWithInput struct { Input Primitive DMLs []Primitive OutputCols [][]int BVList []map[string]int // contains filtered or unexported fields }
DMLWithInput represents the instructions to perform a DML operation based on the input result.
func (*DMLWithInput) CachedSize ¶
func (cached *DMLWithInput) CachedSize(alloc bool) int64
func (*DMLWithInput) GetFields ¶
func (dml *DMLWithInput) GetFields(context.Context, VCursor, map[string]*querypb.BindVariable) (*sqltypes.Result, error)
GetFields fetches the field info.
func (*DMLWithInput) GetKeyspaceName ¶
func (dml *DMLWithInput) GetKeyspaceName() string
func (*DMLWithInput) GetTableName ¶
func (dml *DMLWithInput) GetTableName() string
func (DMLWithInput) NeedsTransaction ¶
func (DMLWithInput) NeedsTransaction() bool
func (*DMLWithInput) RouteType ¶
func (dml *DMLWithInput) RouteType() string
func (*DMLWithInput) TryExecute ¶
func (dml *DMLWithInput) TryExecute(ctx context.Context, vcursor VCursor, bindVars map[string]*querypb.BindVariable, _ bool) (*sqltypes.Result, error)
TryExecute performs a non-streaming exec.
func (*DMLWithInput) TryStreamExecute ¶
func (dml *DMLWithInput) TryStreamExecute(ctx context.Context, vcursor VCursor, bindVars map[string]*querypb.BindVariable, wantfields bool, callback func(*sqltypes.Result) error) error
TryStreamExecute performs a streaming exec.
type Delete ¶
type Delete struct { *DML // contains filtered or unexported fields }
Delete represents the instructions to perform a delete.
func (*Delete) CachedSize ¶
func (*Delete) GetFields ¶
func (del *Delete) GetFields(context.Context, VCursor, map[string]*querypb.BindVariable) (*sqltypes.Result, error)
GetFields fetches the field info.
func (Delete) NeedsTransaction ¶
func (Delete) NeedsTransaction() bool
type Distinct ¶
Distinct Primitive is used to uniqueify results
func (*Distinct) CachedSize ¶
func (*Distinct) GetFields ¶
func (d *Distinct) GetFields(ctx context.Context, vcursor VCursor, bindVars map[string]*querypb.BindVariable) (*sqltypes.Result, error)
GetFields implements the Primitive interface
func (*Distinct) GetKeyspaceName ¶
GetKeyspaceName implements the Primitive interface
func (*Distinct) GetTableName ¶
GetTableName implements the Primitive interface
func (*Distinct) NeedsTransaction ¶
NeedsTransaction implements the Primitive interface
type ExecStmt ¶
func (*ExecStmt) CachedSize ¶
func (*ExecStmt) GetKeyspaceName ¶
func (*ExecStmt) GetTableName ¶
func (*ExecStmt) NeedsTransaction ¶
func (*ExecStmt) TryExecute ¶
type ExecuteEntry ¶
type Filter ¶
type Filter struct { Predicate evalengine.Expr ASTPredicate sqlparser.Expr Input Primitive Truncate int // contains filtered or unexported fields }
Filter is a primitive that performs the FILTER operation.
func (*Filter) CachedSize ¶
func (*Filter) GetFields ¶
func (f *Filter) GetFields(ctx context.Context, vcursor VCursor, bindVars map[string]*querypb.BindVariable) (*sqltypes.Result, error)
GetFields implements the Primitive interface.
func (*Filter) GetKeyspaceName ¶
GetKeyspaceName specifies the Keyspace that this primitive routes to.
func (*Filter) GetTableName ¶
GetTableName specifies the table that this primitive routes to.
func (Filter) NeedsTransaction ¶
func (Filter) NeedsTransaction() bool
func (*Filter) RouteType ¶
RouteType returns a description of the query routing type used by the primitive
type FkCascade ¶
type FkCascade struct { // Selection is the Primitive that is used to find the rows that are going to be modified in the child tables. Selection Primitive // Children is a list of child foreign key Primitives that are executed using rows from the Selection Primitive. Children []*FkChild // Parent is the Primitive that is executed after the children are modified. Parent Primitive // contains filtered or unexported fields }
FkCascade is a primitive that implements foreign key cascading using Selection as values required to execute the FkChild Primitives. On success, it executes the Parent Primitive.
func (*FkCascade) CachedSize ¶
func (*FkCascade) GetFields ¶
func (fkc *FkCascade) GetFields(_ context.Context, _ VCursor, _ map[string]*querypb.BindVariable) (*sqltypes.Result, error)
GetFields implements the Primitive interface.
func (*FkCascade) GetKeyspaceName ¶
GetKeyspaceName implements the Primitive interface.
func (*FkCascade) GetTableName ¶
GetTableName implements the Primitive interface.
func (FkCascade) NeedsTransaction ¶
func (FkCascade) NeedsTransaction() bool
type FkChild ¶
type FkChild struct { // BVName is the bind variable name for the tuple bind variable used in the primitive. BVName string // Cols are the indexes of the column that need to be selected from the SELECT query to create the tuple bind variable. Cols []int // NonLiteralInfo stores the information that is needed to run an update query with non-literal values. NonLiteralInfo []NonLiteralUpdateInfo Exec Primitive }
FkChild contains the Child Primitive to be executed collecting the values from the Selection Primitive using the column indexes. BVName is used to pass the value as bind variable to the Child Primitive.
func (*FkChild) CachedSize ¶
type FkVerify ¶
FkVerify is a primitive that verifies that the foreign key constraints in parent tables are satisfied. It does this by executing a select distinct query on the parent table with the values that are being inserted/updated.
func (*FkVerify) CachedSize ¶
func (*FkVerify) GetFields ¶
func (f *FkVerify) GetFields(ctx context.Context, vcursor VCursor, bindVars map[string]*querypb.BindVariable) (*sqltypes.Result, error)
GetFields implements the Primitive interface
func (*FkVerify) GetKeyspaceName ¶
GetKeyspaceName implements the Primitive interface
func (*FkVerify) GetTableName ¶
GetTableName implements the Primitive interface
func (FkVerify) NeedsTransaction ¶
func (FkVerify) NeedsTransaction() bool
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 expression. New // values will be generated based on how many were not // supplied (NULL). Values evalengine.Expr // Insert using Select, offset for auto increment column Offset int }
Generate represents the instruction to generate a value from a sequence.
func (*Generate) CachedSize ¶
type GroupByParams ¶
type GroupByParams struct { KeyCol int WeightStringCol int Expr sqlparser.Expr FromGroupBy bool Type evalengine.Type CollationEnv *collations.Environment }
GroupByParams specify the grouping key to be used.
func (*GroupByParams) CachedSize ¶
func (cached *GroupByParams) CachedSize(alloc bool) int64
func (GroupByParams) String ¶
func (gbp GroupByParams) String() string
String returns a string. Used for plan descriptions
type HashJoin ¶
type HashJoin 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"` // The keys correspond to the column offset in the inputs where // the join columns can be found LHSKey, RHSKey int // The join condition. Used for plan descriptions ASTPred sqlparser.Expr // collation and type are used to hash the incoming values correctly Collation collations.ID ComparisonType querypb.Type CollationEnv *collations.Environment // Values for enum and set types Values *evalengine.EnumSetValues }
HashJoin specifies the parameters for a join primitive Hash joins work by fetch all the input from the LHS, and building a hash map, known as the probe table, for this input. The key to the map is the hashcode of the value for column that we are joining by. Then the RHS is fetched, and we can check if the rows from the RHS matches any from the LHS. When they match by hash code, we double-check that we are not working with a false positive by comparing the values.
func (*HashJoin) CachedSize ¶
func (*HashJoin) GetFields ¶
func (hj *HashJoin) GetFields(ctx context.Context, vcursor VCursor, bindVars map[string]*querypb.BindVariable) (*sqltypes.Result, error)
GetFields implements the Primitive interface
func (*HashJoin) GetKeyspaceName ¶
GetKeyspaceName implements the Primitive interface
func (*HashJoin) GetTableName ¶
GetTableName implements the Primitive interface
func (*HashJoin) NeedsTransaction ¶
NeedsTransaction implements the Primitive interface
type Insert ¶
type Insert struct { InsertCommon // 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 [][][]evalengine.Expr // Mid is the row values for the sharded insert plans. Mid sqlparser.Values // Alias represents the row alias with columns if specified in the query. Alias string // contains filtered or unexported fields }
Insert represents the instructions to perform an insert operation.
func (*Insert) CachedSize ¶
func (Insert) NeedsTransaction ¶
func (Insert) NeedsTransaction() bool
func (*Insert) RouteType ¶
RouteType returns a description of the query routing type used by the primitive
type InsertCommon ¶
type InsertCommon struct { // Opcode is the execution opcode. Opcode InsertOpcode // Keyspace specifies the keyspace to send the query to. Keyspace *vindexes.Keyspace // Ignore is for INSERT IGNORE and INSERT...ON DUPLICATE KEY constructs // for sharded cases. Ignore bool // TableName is the name of the table on which row will be inserted. TableName 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 // ForceNonStreaming is true when the insert table and select table are same. // This will avoid locking by the select table. ForceNonStreaming bool PreventAutoCommit bool // Generate is only set for inserts where a sequence must be generated. Generate *Generate // ColVindexes are the vindexes that will use the VindexValues ColVindexes []*vindexes.ColumnVindex // Prefix, Suffix are for sharded insert plans. Prefix string Suffix sqlparser.OnDup // contains filtered or unexported fields }
func (*InsertCommon) CachedSize ¶
func (cached *InsertCommon) CachedSize(alloc bool) int64
func (*InsertCommon) GetFields ¶
func (ic *InsertCommon) GetFields(context.Context, VCursor, map[string]*querypb.BindVariable) (*sqltypes.Result, error)
GetFields fetches the field info.
func (*InsertCommon) GetKeyspaceName ¶
func (ic *InsertCommon) GetKeyspaceName() string
GetKeyspaceName specifies the Keyspace that this primitive routes to.
func (*InsertCommon) GetTableName ¶
func (ic *InsertCommon) GetTableName() string
GetTableName specifies the table that this primitive routes to.
func (InsertCommon) NeedsTransaction ¶
func (InsertCommon) NeedsTransaction() bool
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 InsertSelect ¶
type InsertSelect struct { InsertCommon // Input is a select query plan to retrieve results for inserting data. Input Primitive // VindexValueOffset stores the offset for each column in the ColumnVindex // that will appear in the result set of the select query. VindexValueOffset [][]int }
InsertSelect represents the instructions to perform an insert operation with input rows from a select.
func (*InsertSelect) CachedSize ¶
func (cached *InsertSelect) CachedSize(alloc bool) int64
func (InsertSelect) NeedsTransaction ¶
func (InsertSelect) NeedsTransaction() bool
func (*InsertSelect) RouteType ¶
func (ins *InsertSelect) RouteType() string
RouteType returns a description of the query routing type used by the primitive
func (*InsertSelect) TryExecute ¶
func (ins *InsertSelect) TryExecute(ctx context.Context, vcursor VCursor, bindVars map[string]*querypb.BindVariable, _ bool) (*sqltypes.Result, error)
TryExecute performs a non-streaming exec.
func (*InsertSelect) TryStreamExecute ¶
func (ins *InsertSelect) TryStreamExecute(ctx context.Context, vcursor VCursor, bindVars map[string]*querypb.BindVariable, wantfields bool, callback func(*sqltypes.Result) error) error
TryStreamExecute performs a streaming exec.
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 ¶
func (*Join) GetFields ¶
func (jn *Join) GetFields(ctx context.Context, 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 ¶
type Limit struct { Count evalengine.Expr Offset evalengine.Expr Input Primitive }
Limit is a primitive that performs the LIMIT operation.
func (*Limit) CachedSize ¶
func (*Limit) GetFields ¶
func (l *Limit) GetFields(ctx context.Context, 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 ¶
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 FieldQuery string LockFunctions []*LockFunc // contains filtered or unexported fields }
Lock primitive will execute sql containing lock functions
func (*Lock) CachedSize ¶
func (*Lock) GetFields ¶
func (l *Lock) GetFields(ctx context.Context, vcursor VCursor, bindVars map[string]*querypb.BindVariable) (*sqltypes.Result, error)
GetFields is part of the Primitive interface
func (*Lock) GetKeyspaceName ¶
GetKeyspaceName is part of the Primitive interface
func (*Lock) GetTableName ¶
GetTableName is part of the Primitive interface
func (Lock) NeedsTransaction ¶
func (Lock) NeedsTransaction() bool
type LockFunc ¶
type LockFunc struct { Typ *sqlparser.LockingFunc Name evalengine.Expr }
func (*LockFunc) CachedSize ¶
type MStream ¶
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 ¶
func (*MStream) GetFields ¶
func (m *MStream) GetFields(ctx context.Context, vcursor VCursor, bindVars map[string]*querypb.BindVariable) (*sqltypes.Result, error)
GetFields implements the Primitive interface
func (*MStream) GetKeyspaceName ¶
GetKeyspaceName implements the Primitive interface
func (*MStream) GetTableName ¶
GetTableName implements the Primitive interface
func (MStream) NeedsTransaction ¶
func (MStream) NeedsTransaction() bool
type MemorySort ¶
type MemorySort struct { UpperLimit evalengine.Expr OrderBy evalengine.Comparison 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 ¶
func (cached *MemorySort) CachedSize(alloc bool) int64
func (*MemorySort) GetFields ¶
func (ms *MemorySort) GetFields(ctx context.Context, 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, []map[string]any)
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) TryExecute ¶
func (ms *MemorySort) TryExecute(ctx context.Context, vcursor VCursor, bindVars map[string]*querypb.BindVariable, wantfields bool) (*sqltypes.Result, error)
TryExecute satisfies the Primitive interface.
func (*MemorySort) TryStreamExecute ¶
func (ms *MemorySort) TryStreamExecute(ctx context.Context, vcursor VCursor, bindVars map[string]*querypb.BindVariable, wantfields bool, callback func(*sqltypes.Result) error) (err error)
TryStreamExecute satisfies the Primitive interface.
type MergeSort ¶
type MergeSort struct { Primitives []StreamExecutor OrderBy evalengine.Comparison 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 ¶
func (*MergeSort) GetFields ¶
func (ms *MergeSort) GetFields(ctx context.Context, 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 NonLiteralUpdateInfo ¶
NonLiteralUpdateInfo stores the information required to process non-literal update queries. It stores 4 information- 1. CompExprCol- The index of the comparison expression in the select query to know if the row value is actually being changed or not. 2. UpdateExprCol- The index of the updated expression in the select query. 3. UpdateExprBvName- The bind variable name to store the updated expression into.
func (*NonLiteralUpdateInfo) CachedSize ¶
func (cached *NonLiteralUpdateInfo) CachedSize(alloc bool) int64
type OnlineDDL ¶
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 ¶
func (*OnlineDDL) GetFields ¶
func (v *OnlineDDL) GetFields(ctx context.Context, vcursor VCursor, bindVars map[string]*querypb.BindVariable) (*sqltypes.Result, error)
GetFields implements the Primitive interface
func (*OnlineDDL) GetKeyspaceName ¶
GetKeyspaceName implements the Primitive interface
func (*OnlineDDL) GetTableName ¶
GetTableName implements the Primitive interface
func (OnlineDDL) NeedsTransaction ¶
func (OnlineDDL) NeedsTransaction() bool
type Opcode ¶
type Opcode int
Opcode is a number representing the opcode for any engine primitve.
func (Opcode) IsSingleShard ¶
func (Opcode) MarshalJSON ¶
MarshalJSON serializes the Opcode as a JSON string. It's used for testing and diagnostics.
type OrderedAggregate ¶
type OrderedAggregate struct { // 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 ¶
func (cached *OrderedAggregate) CachedSize(alloc bool) int64
func (*OrderedAggregate) GetFields ¶
func (oa *OrderedAggregate) GetFields(ctx context.Context, 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, []map[string]any)
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) TryExecute ¶
func (oa *OrderedAggregate) TryExecute(ctx context.Context, vcursor VCursor, bindVars map[string]*querypb.BindVariable, _ bool) (*sqltypes.Result, error)
TryExecute is a Primitive function.
func (*OrderedAggregate) TryStreamExecute ¶
func (oa *OrderedAggregate) TryStreamExecute(ctx context.Context, vcursor VCursor, bindVars map[string]*querypb.BindVariable, _ 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 []*query.QueryWarning // Warnings that need to be yielded every time this query runs TablesUsed []string // TablesUsed is the list of tables that this plan will query 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 ¶
func (*Plan) MarshalJSON ¶
MarshalJSON serializes the plan into a JSON representation.
type Primitive ¶
type Primitive interface { RouteType() string GetKeyspaceName() string GetTableName() string GetFields(ctx context.Context, vcursor VCursor, bindVars map[string]*querypb.BindVariable) (*sqltypes.Result, error) NeedsTransaction() bool TryExecute(ctx context.Context, vcursor VCursor, bindVars map[string]*querypb.BindVariable, wantfields bool) (*sqltypes.Result, error) TryStreamExecute(ctx context.Context, 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. // The returned map has additional information about the inputs, that is used in the description. Inputs() ([]Primitive, []map[string]any) // 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]any InputName string 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 ¶
func (cached *Projection) CachedSize(alloc bool) int64
func (*Projection) GetFields ¶
func (p *Projection) GetFields(ctx context.Context, 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, []map[string]any)
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 ¶
func (p *Projection) TryExecute(ctx context.Context, vcursor VCursor, bindVars map[string]*querypb.BindVariable, wantfields bool) (*sqltypes.Result, error)
TryExecute implements the Primitive interface
func (*Projection) TryStreamExecute ¶
func (p *Projection) TryStreamExecute(ctx context.Context, vcursor VCursor, bindVars map[string]*querypb.BindVariable, wantfields bool, callback func(*sqltypes.Result) error) error
TryStreamExecute implements the Primitive interface
type RenameFields ¶
type RenameFields struct { Cols []string Indices []int Input Primitive // contains filtered or unexported fields }
RenameFields is a primitive that renames the fields
func NewRenameField ¶
func NewRenameField(cols []string, indices []int, input Primitive) (*RenameFields, error)
NewRenameField creates a new rename field
func (*RenameFields) CachedSize ¶
func (cached *RenameFields) CachedSize(alloc bool) int64
func (*RenameFields) GetFields ¶
func (r *RenameFields) GetFields(ctx context.Context, vcursor VCursor, bindVars map[string]*querypb.BindVariable) (*sqltypes.Result, error)
GetFields implements the primitive interface
func (*RenameFields) GetKeyspaceName ¶
func (r *RenameFields) GetKeyspaceName() string
GetKeyspaceName implements the primitive interface
func (*RenameFields) GetTableName ¶
func (r *RenameFields) GetTableName() string
GetTableName implements the primitive interface
func (*RenameFields) Inputs ¶
func (r *RenameFields) Inputs() ([]Primitive, []map[string]any)
Inputs implements the primitive interface
func (RenameFields) NeedsTransaction ¶
func (RenameFields) NeedsTransaction() bool
func (*RenameFields) RouteType ¶
func (r *RenameFields) RouteType() string
RouteType implements the primitive interface
func (*RenameFields) TryExecute ¶
func (r *RenameFields) TryExecute(ctx context.Context, vcursor VCursor, bindVars map[string]*querypb.BindVariable, wantfields bool) (*sqltypes.Result, error)
TryExecute implements the Primitive interface
func (*RenameFields) TryStreamExecute ¶
func (r *RenameFields) TryStreamExecute(ctx context.Context, vcursor VCursor, bindVars map[string]*querypb.BindVariable, wantfields bool, callback func(*sqltypes.Result) error) error
TryStreamExecute implements the Primitive interface
type ReplaceVariables ¶
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 ¶
func NewReplaceVariables(input Primitive) *ReplaceVariables
NewReplaceVariables is used to create a new ReplaceVariables primitive
func (*ReplaceVariables) CachedSize ¶
func (cached *ReplaceVariables) CachedSize(alloc bool) int64
func (*ReplaceVariables) GetFields ¶
func (r *ReplaceVariables) GetFields(ctx context.Context, vcursor VCursor, bindVars map[string]*querypb.BindVariable) (*sqltypes.Result, error)
GetFields implements the Primitive interface
func (*ReplaceVariables) GetKeyspaceName ¶
func (r *ReplaceVariables) GetKeyspaceName() string
GetKeyspaceName implements the Primitive interface
func (*ReplaceVariables) GetTableName ¶
func (r *ReplaceVariables) GetTableName() string
GetTableName implements the Primitive interface
func (*ReplaceVariables) Inputs ¶
func (r *ReplaceVariables) Inputs() ([]Primitive, []map[string]any)
Inputs implements the Primitive interface
func (ReplaceVariables) NeedsTransaction ¶
func (ReplaceVariables) NeedsTransaction() bool
func (*ReplaceVariables) RouteType ¶
func (r *ReplaceVariables) RouteType() string
RouteType implements the Primitive interface
func (*ReplaceVariables) TryExecute ¶
func (r *ReplaceVariables) TryExecute(ctx context.Context, vcursor VCursor, bindVars map[string]*querypb.BindVariable, wantfields bool) (*sqltypes.Result, error)
TryExecute implements the Primitive interface
func (*ReplaceVariables) TryStreamExecute ¶
func (r *ReplaceVariables) TryStreamExecute(ctx context.Context, vcursor VCursor, bindVars map[string]*querypb.BindVariable, wantfields bool, callback func(*sqltypes.Result) error) error
TryStreamExecute implements the Primitive interface
type RevertMigration ¶
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 ¶
func (cached *RevertMigration) CachedSize(alloc bool) int64
func (*RevertMigration) GetFields ¶
func (v *RevertMigration) GetFields(ctx context.Context, vcursor VCursor, bindVars map[string]*querypb.BindVariable) (*sqltypes.Result, error)
GetFields implements the Primitive interface
func (*RevertMigration) GetKeyspaceName ¶
func (v *RevertMigration) GetKeyspaceName() string
GetKeyspaceName implements the Primitive interface
func (*RevertMigration) GetTableName ¶
func (v *RevertMigration) GetTableName() string
GetTableName implements the Primitive interface
func (RevertMigration) NeedsTransaction ¶
func (RevertMigration) NeedsTransaction() bool
func (*RevertMigration) RouteType ¶
func (v *RevertMigration) RouteType() string
RouteType implements the Primitive interface
func (*RevertMigration) TryExecute ¶
func (v *RevertMigration) TryExecute(ctx context.Context, vcursor VCursor, bindVars map[string]*querypb.BindVariable, wantfields bool) (result *sqltypes.Result, err error)
TryExecute implements the Primitive interface
func (*RevertMigration) TryStreamExecute ¶
func (v *RevertMigration) TryStreamExecute(ctx context.Context, vcursor VCursor, bindVars map[string]*querypb.BindVariable, wantfields bool, callback func(*sqltypes.Result) error) error
TryStreamExecute implements the Primitive interface
type Route ¶
type Route struct { // 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 tables to send the query to. TableName string // FieldQuery specifies the query to be executed for a GetFieldInfo request. FieldQuery string // 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 evalengine.Comparison // 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 // RoutingParameters parameters required for query routing. *RoutingParameters // NoRoutesSpecialHandling will make the route send a query to arbitrary shard if the routing logic can't find // the correct shard. This is important for queries where no matches does not mean empty result - examples would be: // select count(*) from tbl where lookupColumn = 'not there' // select exists(<subq>) NoRoutesSpecialHandling bool // contains filtered or unexported fields }
Route represents the instructions to route a read query to one or many vttablets.
func (*Route) CachedSize ¶
func (*Route) GetFields ¶
func (route *Route) GetFields(ctx context.Context, 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
type RoutingParameters ¶
type RoutingParameters struct { // Opcode is the execution opcode. Opcode Opcode // Keyspace specifies the keyspace to send the query to. Keyspace *vindexes.Keyspace // The following two fields are used when routing information_schema queries SysTableTableSchema []evalengine.Expr SysTableTableName map[string]evalengine.Expr // TargetDestination specifies an explicit target destination to send the query to. // This will bypass the routing logic. TargetDestination key.Destination // update `user[-]@replica`.user set .... // Vindex specifies the vindex to be used. Vindex vindexes.Vindex // Values specifies the vindex values to use for routing. Values []evalengine.Expr }
func (*RoutingParameters) CachedSize ¶
func (cached *RoutingParameters) CachedSize(alloc bool) int64
type Rows ¶
type Rows struct {
// contains filtered or unexported fields
}
Rows simply returns a number or rows
func (*Rows) CachedSize ¶
func (*Rows) GetFields ¶
func (r *Rows) GetFields(context.Context, VCursor, map[string]*querypb.BindVariable) (*sqltypes.Result, error)
GetFields implements the Primitive interface
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 ¶
SQLCalcFoundRows is a primitive to execute limit and count query as per their individual plan.
func (*SQLCalcFoundRows) CachedSize ¶
func (cached *SQLCalcFoundRows) CachedSize(alloc bool) int64
func (*SQLCalcFoundRows) GetFields ¶
func (s *SQLCalcFoundRows) GetFields(ctx context.Context, vcursor VCursor, bindVars map[string]*querypb.BindVariable) (*sqltypes.Result, error)
GetFields implements the Primitive interface
func (*SQLCalcFoundRows) GetKeyspaceName ¶
func (s *SQLCalcFoundRows) GetKeyspaceName() string
GetKeyspaceName implements the Primitive interface
func (*SQLCalcFoundRows) GetTableName ¶
func (s *SQLCalcFoundRows) GetTableName() string
GetTableName implements the Primitive interface
func (*SQLCalcFoundRows) Inputs ¶
func (s *SQLCalcFoundRows) Inputs() ([]Primitive, []map[string]any)
Inputs implements the Primitive interface
func (*SQLCalcFoundRows) NeedsTransaction ¶
func (s *SQLCalcFoundRows) NeedsTransaction() bool
NeedsTransaction implements the Primitive interface
func (*SQLCalcFoundRows) RouteType ¶
func (s *SQLCalcFoundRows) RouteType() string
RouteType implements the Primitive interface
func (*SQLCalcFoundRows) TryExecute ¶
func (s *SQLCalcFoundRows) TryExecute(ctx context.Context, vcursor VCursor, bindVars map[string]*querypb.BindVariable, wantfields bool) (*sqltypes.Result, error)
TryExecute implements the Primitive interface
func (*SQLCalcFoundRows) TryStreamExecute ¶
func (s *SQLCalcFoundRows) TryStreamExecute(ctx context.Context, vcursor VCursor, bindVars map[string]*querypb.BindVariable, wantfields bool, callback func(*sqltypes.Result) error) error
TryStreamExecute implements the Primitive interface
type ScalarAggregate ¶
type ScalarAggregate struct { // Aggregates specifies the aggregation parameters for each // aggregation function: function opcode and input column number. Aggregates []*AggregateParams // 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 }
ScalarAggregate is a primitive used to do aggregations without grouping keys
func (*ScalarAggregate) CachedSize ¶
func (cached *ScalarAggregate) CachedSize(alloc bool) int64
func (*ScalarAggregate) GetFields ¶
func (sa *ScalarAggregate) GetFields(ctx context.Context, vcursor VCursor, bindVars map[string]*querypb.BindVariable) (*sqltypes.Result, error)
GetFields implements the Primitive interface
func (*ScalarAggregate) GetKeyspaceName ¶
func (sa *ScalarAggregate) GetKeyspaceName() string
GetKeyspaceName implements the Primitive interface
func (*ScalarAggregate) GetTableName ¶
func (sa *ScalarAggregate) GetTableName() string
GetTableName implements the Primitive interface
func (*ScalarAggregate) Inputs ¶
func (sa *ScalarAggregate) Inputs() ([]Primitive, []map[string]any)
Inputs implements the Primitive interface
func (*ScalarAggregate) NeedsTransaction ¶
func (sa *ScalarAggregate) NeedsTransaction() bool
NeedsTransaction implements the Primitive interface
func (*ScalarAggregate) RouteType ¶
func (sa *ScalarAggregate) RouteType() string
RouteType implements the Primitive interface
func (*ScalarAggregate) TryExecute ¶
func (sa *ScalarAggregate) TryExecute(ctx context.Context, vcursor VCursor, bindVars map[string]*querypb.BindVariable, wantfields bool) (*sqltypes.Result, error)
TryExecute implements the Primitive interface
func (*ScalarAggregate) TryStreamExecute ¶
func (sa *ScalarAggregate) TryStreamExecute(ctx context.Context, vcursor VCursor, bindVars map[string]*querypb.BindVariable, wantfields bool, callback func(*sqltypes.Result) error) error
TryStreamExecute implements the Primitive interface
type SemiJoin ¶
type SemiJoin struct {
// Left and Right are the LHS and RHS primitives
// of the SemiJoin. They can be any primitive.
Left, Right Primitive `json:",omitempty"`
// Vars defines the list of SemiJoinVars that need to
// be built from the LHS result before invoking
// the RHS subquery.
Vars map[string]int `json:",omitempty"`
}
SemiJoin specifies the parameters for a SemiJoin primitive.
func (*SemiJoin) CachedSize ¶
func (*SemiJoin) GetFields ¶
func (jn *SemiJoin) GetFields(ctx context.Context, vcursor VCursor, bindVars map[string]*querypb.BindVariable) (*sqltypes.Result, error)
GetFields fetches the field info.
func (*SemiJoin) GetKeyspaceName ¶
GetKeyspaceName specifies the Keyspace that this primitive routes to.
func (*SemiJoin) GetTableName ¶
GetTableName specifies the table that this primitive routes to.
func (*SemiJoin) NeedsTransaction ¶
NeedsTransaction implements the Primitive interface
func (*SemiJoin) RouteType ¶
RouteType returns a description of the query routing type used by the primitive
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 ReservedConnectionNeeded bool // QueryTimeout contains the optional timeout (in milliseconds) to apply to this query QueryTimeout int // contains filtered or unexported fields }
Send is an operator to send query to the specific keyspace, tabletType and destination
func (*Send) CachedSize ¶
func (*Send) GetFields ¶
func (s *Send) GetFields(ctx context.Context, 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 Sequential ¶
type Sequential struct { Sources []Primitive // contains filtered or unexported fields }
Sequential Primitive is used to execute DML statements in a fixed order. Any failure, stops the execution and returns.
func NewSequential ¶
func NewSequential(Sources []Primitive) *Sequential
NewSequential creates a Sequential primitive.
func (*Sequential) CachedSize ¶
func (cached *Sequential) CachedSize(alloc bool) int64
func (*Sequential) GetFields ¶
func (s *Sequential) GetFields(context.Context, VCursor, map[string]*querypb.BindVariable) (*sqltypes.Result, error)
GetFields fetches the field info.
func (*Sequential) GetKeyspaceName ¶
func (s *Sequential) GetKeyspaceName() string
GetKeyspaceName specifies the Keyspace that this primitive routes to
func (*Sequential) GetTableName ¶
func (s *Sequential) GetTableName() string
GetTableName specifies the table that this primitive routes to.
func (*Sequential) Inputs ¶
func (s *Sequential) Inputs() ([]Primitive, []map[string]any)
Inputs returns the input primitives for this
func (Sequential) NeedsTransaction ¶
func (Sequential) NeedsTransaction() bool
func (*Sequential) RouteType ¶
func (s *Sequential) RouteType() string
RouteType returns a description of the query routing type used by the primitive
func (*Sequential) TryExecute ¶
func (s *Sequential) TryExecute(ctx context.Context, vcursor VCursor, bindVars map[string]*querypb.BindVariable, wantFields bool) (*sqltypes.Result, error)
TryExecute performs a non-streaming exec.
func (*Sequential) TryStreamExecute ¶
func (s *Sequential) TryStreamExecute(ctx context.Context, vcursor VCursor, bindVars map[string]*querypb.BindVariable, wantFields bool, callback func(*sqltypes.Result) error) error
TryStreamExecute performs a streaming exec.
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 any) error GetUDV(key string) *querypb.BindVariable 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(ctx context.Context, autocommit bool) error SetClientFoundRows(context.Context, bool) error SetSkipQueryPlanCache(context.Context, bool) error SetSQLSelectLimit(int64) error SetTransactionMode(vtgatepb.TransactionMode) SetWorkload(querypb.ExecuteOptions_Workload) SetPlannerVersion(querypb.ExecuteOptions_PlannerVersion) SetConsolidator(querypb.ExecuteOptions_Consolidator) SetWorkloadName(string) SetPriority(string) SetFoundRows(uint64) SetDDLStrategy(string) GetDDLStrategy() string SetMigrationContext(string) GetMigrationContext() string GetSessionUUID() string SetSessionEnableSystemSettings(context.Context, bool) error GetSessionEnableSystemSettings() bool GetSystemVariables(func(k string, v string)) HasSystemVariables() 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 // AnyAdvisoryLockTaken returns true of any advisory lock is taken AnyAdvisoryLockTaken() bool // AddAdvisoryLock adds advisory lock to the session AddAdvisoryLock(name string) // RemoveAdvisoryLock removes advisory lock from the session RemoveAdvisoryLock(name string) // VExplainLogging enables logging of all interactions to the tablets so // VEXPLAIN QUERIES/ALL can report what's being done VExplainLogging() // GetVExplainLogs retrieves the vttablet interaction logs GetVExplainLogs() []ExecuteEntry // SetCommitOrder sets the commit order for the shard session in respect of the type of vindex lookup. // This is used to select the right shard session to perform the vindex lookup query. SetCommitOrder(co vtgatepb.CommitOrder) // GetQueryTimeout gets the query timeout and takes in the query timeout from comments GetQueryTimeout(queryTimeoutFromComment int) int // SetQueryTimeout sets the query timeout SetQueryTimeout(queryTimeout int64) // InTransaction returns true if the session has already opened transaction or // will start a transaction on the query execution. InTransaction() bool Commit(ctx context.Context) error }
SessionActions gives primitives ability to interact with the session state
type SessionPrimitive ¶
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 ¶
func NewSessionPrimitive(name string, action func(sa SessionActions) (*sqltypes.Result, error)) *SessionPrimitive
NewSessionPrimitive creates a SessionPrimitive
func (*SessionPrimitive) CachedSize ¶
func (cached *SessionPrimitive) CachedSize(alloc bool) int64
func (*SessionPrimitive) GetFields ¶
func (s *SessionPrimitive) GetFields(ctx context.Context, vcursor VCursor, bindVars map[string]*querypb.BindVariable) (*sqltypes.Result, error)
GetFields implements the Primitive interface
func (*SessionPrimitive) GetKeyspaceName ¶
func (s *SessionPrimitive) GetKeyspaceName() string
GetKeyspaceName implements the Primitive interface
func (*SessionPrimitive) GetTableName ¶
func (s *SessionPrimitive) GetTableName() string
GetTableName implements the Primitive interface
func (SessionPrimitive) NeedsTransaction ¶
func (SessionPrimitive) NeedsTransaction() bool
func (*SessionPrimitive) RouteType ¶
func (s *SessionPrimitive) RouteType() string
RouteType implements the Primitive interface
func (*SessionPrimitive) TryExecute ¶
func (s *SessionPrimitive) TryExecute(ctx context.Context, vcursor VCursor, bindVars map[string]*querypb.BindVariable, wantfields bool) (*sqltypes.Result, error)
TryExecute implements the Primitive interface
func (*SessionPrimitive) TryStreamExecute ¶
func (s *SessionPrimitive) TryStreamExecute(ctx context.Context, vcursor VCursor, bindVars map[string]*querypb.BindVariable, wantfields bool, callback func(*sqltypes.Result) error) error
TryStreamExecute implements the Primitive interface
type Set ¶
Set contains the instructions to perform set.
func (*Set) CachedSize ¶
func (*Set) GetFields ¶
func (s *Set) GetFields(context.Context, VCursor, map[string]*querypb.BindVariable) (*sqltypes.Result, error)
GetFields implements the Primitive interface method.
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(ctx context.Context, vcursor VCursor, env *evalengine.ExpressionEnv) error VariableName() string }
SetOp is an interface that different type of set operations implements.
type ShowExec ¶
type ShowExec struct { Command sqlparser.ShowCommandType ShowFilter *sqlparser.ShowFilter // contains filtered or unexported fields }
ShowExec is a primitive to call into executor via vcursor.
func (*ShowExec) CachedSize ¶
func (*ShowExec) GetKeyspaceName ¶
func (*ShowExec) GetTableName ¶
func (ShowExec) NeedsTransaction ¶
func (ShowExec) NeedsTransaction() bool
func (*ShowExec) TryExecute ¶
type SimpleProjection ¶
type SimpleProjection struct { // Cols defines the column numbers from the underlying primitive // to be returned. Cols []int // ColNames are the column names to use for the columns. ColNames []string Input Primitive }
SimpleProjection selects which columns to keep from the input
func (*SimpleProjection) CachedSize ¶
func (cached *SimpleProjection) CachedSize(alloc bool) int64
func (*SimpleProjection) GetFields ¶
func (sc *SimpleProjection) GetFields(ctx context.Context, vcursor VCursor, bindVars map[string]*querypb.BindVariable) (*sqltypes.Result, error)
GetFields fetches the field info.
func (*SimpleProjection) GetKeyspaceName ¶
func (sc *SimpleProjection) GetKeyspaceName() string
GetKeyspaceName specifies the Keyspace that this primitive routes to.
func (*SimpleProjection) GetTableName ¶
func (sc *SimpleProjection) GetTableName() string
GetTableName specifies the table that this primitive routes to.
func (*SimpleProjection) Inputs ¶
func (sc *SimpleProjection) Inputs() ([]Primitive, []map[string]any)
Inputs returns the input to this primitive
func (*SimpleProjection) NeedsTransaction ¶
func (sc *SimpleProjection) NeedsTransaction() bool
NeedsTransaction implements the Primitive interface
func (*SimpleProjection) RouteType ¶
func (sc *SimpleProjection) RouteType() string
RouteType returns a description of the query routing type used by the primitive
func (*SimpleProjection) TryExecute ¶
func (sc *SimpleProjection) TryExecute(ctx context.Context, vcursor VCursor, bindVars map[string]*querypb.BindVariable, wantfields bool) (*sqltypes.Result, error)
TryExecute performs a non-streaming exec.
func (*SimpleProjection) TryStreamExecute ¶
func (sc *SimpleProjection) TryStreamExecute(ctx context.Context, 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(ctx context.Context, vcursor VCursor, bindVars map[string]*querypb.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(ctx context.Context, vcursor VCursor, bindVars map[string]*querypb.BindVariable, wantfields 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 ¶
func (cached *SysVarCheckAndIgnore) CachedSize(alloc bool) int64
func (*SysVarCheckAndIgnore) Execute ¶
func (svci *SysVarCheckAndIgnore) Execute(ctx context.Context, 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 ¶
func (cached *SysVarIgnore) CachedSize(alloc bool) int64
func (*SysVarIgnore) Execute ¶
func (svi *SysVarIgnore) Execute(context.Context, 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 ¶
type SysVarReservedConn struct { Name string Keyspace *vindexes.Keyspace TargetDestination key.Destination `json:",omitempty"` Expr string SupportSetVar bool }
SysVarReservedConn implements the SetOp interface and will write the changes variable into the session
func (*SysVarReservedConn) CachedSize ¶
func (cached *SysVarReservedConn) CachedSize(alloc bool) int64
func (*SysVarReservedConn) Execute ¶
func (svs *SysVarReservedConn) Execute(ctx context.Context, vcursor VCursor, env *evalengine.ExpressionEnv) error
Execute implements the SetOp interface method
func (*SysVarReservedConn) MarshalJSON ¶
func (svs *SysVarReservedConn) MarshalJSON() ([]byte, error)
MarshalJSON provides the type to SetOp for plan json
func (*SysVarReservedConn) VariableName ¶
func (svs *SysVarReservedConn) VariableName() string
VariableName implements the SetOp interface method
type SysVarSetAware ¶
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 ¶
func (cached *SysVarSetAware) CachedSize(alloc bool) int64
func (*SysVarSetAware) Execute ¶
func (svss *SysVarSetAware) Execute(ctx context.Context, vcursor VCursor, env *evalengine.ExpressionEnv) error
Execute implements the SetOp interface method
func (*SysVarSetAware) MarshalJSON ¶
func (svss *SysVarSetAware) MarshalJSON() ([]byte, error)
MarshalJSON marshals all the json
func (*SysVarSetAware) VariableName ¶
func (svss *SysVarSetAware) VariableName() string
VariableName implements the SetOp interface method
type ThrottleApp ¶
type ThrottleApp struct { Keyspace *vindexes.Keyspace ThrottledAppRule *topodatapb.ThrottledAppRule // contains filtered or unexported fields }
ThrottleApp represents the instructions to perform an online schema change via vtctld
func (*ThrottleApp) CachedSize ¶
func (cached *ThrottleApp) CachedSize(alloc bool) int64
func (*ThrottleApp) GetFields ¶
func (v *ThrottleApp) GetFields(ctx context.Context, vcursor VCursor, bindVars map[string]*querypb.BindVariable) (*sqltypes.Result, error)
GetFields implements the Primitive interface
func (*ThrottleApp) GetKeyspaceName ¶
func (v *ThrottleApp) GetKeyspaceName() string
GetKeyspaceName implements the Primitive interface
func (*ThrottleApp) GetTableName ¶
func (v *ThrottleApp) GetTableName() string
GetTableName implements the Primitive interface
func (ThrottleApp) NeedsTransaction ¶
func (ThrottleApp) NeedsTransaction() bool
func (*ThrottleApp) RouteType ¶
func (v *ThrottleApp) RouteType() string
RouteType implements the Primitive interface
func (*ThrottleApp) TryExecute ¶
func (v *ThrottleApp) TryExecute(ctx context.Context, vcursor VCursor, bindVars map[string]*querypb.BindVariable, wantfields bool) (result *sqltypes.Result, err error)
TryExecute implements the Primitive interface
func (*ThrottleApp) TryStreamExecute ¶
func (v *ThrottleApp) TryStreamExecute(ctx context.Context, vcursor VCursor, bindVars map[string]*querypb.BindVariable, wantfields bool, callback func(*sqltypes.Result) error) error
TryStreamExecute implements the Primitive interface
type UncorrelatedSubquery ¶
type UncorrelatedSubquery struct { // SubqueryResult and HasValues are used to send in the bindvar used in the query to the underlying primitive }
UncorrelatedSubquery executes a subquery once and uses the result as a bind variable for the underlying primitive.
func (*UncorrelatedSubquery) CachedSize ¶
func (cached *UncorrelatedSubquery) CachedSize(alloc bool) int64
func (*UncorrelatedSubquery) GetFields ¶
func (ps *UncorrelatedSubquery) GetFields(ctx context.Context, vcursor VCursor, bindVars map[string]*querypb.BindVariable) (*sqltypes.Result, error)
GetFields fetches the field info.
func (*UncorrelatedSubquery) GetKeyspaceName ¶
func (ps *UncorrelatedSubquery) GetKeyspaceName() string
GetKeyspaceName specifies the Keyspace that this primitive routes to.
func (*UncorrelatedSubquery) GetTableName ¶
func (ps *UncorrelatedSubquery) GetTableName() string
GetTableName specifies the table that this primitive routes to.
func (*UncorrelatedSubquery) Inputs ¶
func (ps *UncorrelatedSubquery) Inputs() ([]Primitive, []map[string]any)
Inputs returns the input primitives for this join
func (*UncorrelatedSubquery) NeedsTransaction ¶
func (ps *UncorrelatedSubquery) NeedsTransaction() bool
NeedsTransaction implements the Primitive interface
func (*UncorrelatedSubquery) RouteType ¶
func (ps *UncorrelatedSubquery) RouteType() string
RouteType returns a description of the query routing type used by the primitive
func (*UncorrelatedSubquery) TryExecute ¶
func (ps *UncorrelatedSubquery) TryExecute(ctx context.Context, vcursor VCursor, bindVars map[string]*querypb.BindVariable, wantfields bool) (*sqltypes.Result, error)
TryExecute satisfies the Primitive interface.
func (*UncorrelatedSubquery) TryStreamExecute ¶
func (ps *UncorrelatedSubquery) TryStreamExecute(ctx context.Context, vcursor VCursor, bindVars map[string]*querypb.BindVariable, wantfields bool, callback func(*sqltypes.Result) error) error
TryStreamExecute performs a streaming exec.
type Unlock ¶
type Unlock struct {
// contains filtered or unexported fields
}
Unlock primitive will execute unlock tables to all connections in the session.
func (*Unlock) GetKeyspaceName ¶
func (*Unlock) GetTableName ¶
func (Unlock) NeedsTransaction ¶
func (Unlock) NeedsTransaction() bool
func (*Unlock) TryExecute ¶
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 ¶
func (*Update) GetFields ¶
func (upd *Update) GetFields(ctx context.Context, vcursor VCursor, bindVars map[string]*querypb.BindVariable) (*sqltypes.Result, error)
GetFields fetches the field info.
func (Update) NeedsTransaction ¶
func (Update) NeedsTransaction() bool
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 ¶
func (cached *UpdateTarget) CachedSize(alloc bool) int64
func (*UpdateTarget) GetFields ¶
func (updTarget *UpdateTarget) GetFields(ctx context.Context, 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 ¶
func (updTarget *UpdateTarget) TryExecute(ctx context.Context, vcursor VCursor, bindVars map[string]*query.BindVariable, wantfields bool) (*sqltypes.Result, error)
TryExecute implements the Primitive interface
func (*UpdateTarget) TryStreamExecute ¶
func (updTarget *UpdateTarget) TryStreamExecute(ctx context.Context, vcursor VCursor, bindVars map[string]*query.BindVariable, wantfields bool, callback func(*sqltypes.Result) error) error
TryStreamExecute implements the Primitive interface
type Upsert ¶
type Upsert struct { Upserts []upsert // contains filtered or unexported fields }
Upsert Primitive will execute the insert primitive first and if there is `Duplicate Key` error, it executes the update primitive.
func (*Upsert) CachedSize ¶
func (*Upsert) GetFields ¶
func (u *Upsert) GetFields(ctx context.Context, vcursor VCursor, bindVars map[string]*querypb.BindVariable) (*sqltypes.Result, error)
GetFields implements Primitive interface type.
func (*Upsert) GetKeyspaceName ¶
GetKeyspaceName implements Primitive interface type.
func (*Upsert) GetTableName ¶
GetTableName implements Primitive interface type.
func (Upsert) NeedsTransaction ¶
func (Upsert) NeedsTransaction() bool
type UserDefinedVariable ¶
type UserDefinedVariable struct { Name string Expr evalengine.Expr }
UserDefinedVariable implements the SetOp interface to execute user defined variables.
func (*UserDefinedVariable) CachedSize ¶
func (cached *UserDefinedVariable) CachedSize(alloc bool) int64
func (*UserDefinedVariable) Execute ¶
func (u *UserDefinedVariable) Execute(ctx context.Context, 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 { 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 Execute(ctx context.Context, method string, query string, bindVars map[string]*querypb.BindVariable, rollbackOnError bool, co vtgatepb.CommitOrder) (*sqltypes.Result, error) AutocommitApproval() bool // Execute the given primitive ExecutePrimitive(ctx context.Context, primitive Primitive, bindVars map[string]*querypb.BindVariable, wantfields bool) (*sqltypes.Result, error) // Execute the given primitive in a new autocommit session ExecutePrimitiveStandalone(ctx context.Context, primitive Primitive, bindVars map[string]*querypb.BindVariable, wantfields bool) (*sqltypes.Result, error) // Execute the given primitive StreamExecutePrimitive(ctx context.Context, primitive Primitive, bindVars map[string]*querypb.BindVariable, wantfields bool, callback func(*sqltypes.Result) error) error // Execute the given primitive in a new autocommit session StreamExecutePrimitiveStandalone(ctx context.Context, primitive Primitive, bindVars map[string]*querypb.BindVariable, wantfields bool, callback func(result *sqltypes.Result) error) error // Shard-level functions. ExecuteMultiShard(ctx context.Context, primitive Primitive, rss []*srvtopo.ResolvedShard, queries []*querypb.BoundQuery, rollbackOnError, canAutocommit bool) (*sqltypes.Result, []error) ExecuteStandalone(ctx context.Context, primitive Primitive, query string, bindVars map[string]*querypb.BindVariable, rs *srvtopo.ResolvedShard) (*sqltypes.Result, error) StreamExecuteMulti(ctx context.Context, primitive Primitive, query string, rss []*srvtopo.ResolvedShard, bindVars []map[string]*querypb.BindVariable, rollbackOnError bool, autocommit bool, callback func(reply *sqltypes.Result) error) []error // Keyspace ID level functions. ExecuteKeyspaceID(ctx context.Context, 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(ctx context.Context, keyspace string, ids []*querypb.Value, destinations []key.Destination) ([]*srvtopo.ResolvedShard, [][]*querypb.Value, error) ResolveDestinationsMultiCol(ctx context.Context, keyspace string, ids [][]sqltypes.Value, destinations []key.Destination) ([]*srvtopo.ResolvedShard, [][][]sqltypes.Value, error) ExecuteVSchema(ctx context.Context, keyspace string, vschemaDDL *sqlparser.AlterVschema) error Session() SessionActions ConnCollation() collations.ID Environment() *vtenv.Environment TimeZone() *time.Location SQLMode() string ExecuteLock(ctx context.Context, rs *srvtopo.ResolvedShard, query *querypb.BoundQuery, lockFuncType sqlparser.LockingFuncType) (*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(ctx context.Context, rss []*srvtopo.ResolvedShard, tableName string, callback func(*sqltypes.Result) error) error VStream(ctx context.Context, rss []*srvtopo.ResolvedShard, filter *binlogdatapb.Filter, gtid string, callback func(evs []*binlogdatapb.VEvent) error) error // ShowExec takes in show command and use executor to execute the query, they are used when topo access is involved. ShowExec(ctx context.Context, command sqlparser.ShowCommandType, filter *sqlparser.ShowFilter) (*sqltypes.Result, error) // SetExec takes in k,v pair and use executor to set them in topo metadata. SetExec(ctx context.Context, name string, value string) error // ThrottleApp sets a ThrottlerappRule in topo ThrottleApp(ctx context.Context, throttleAppRule *topodatapb.ThrottledAppRule) error // CanUseSetVar returns true if system_settings can use SET_VAR hint. CanUseSetVar() bool // ReleaseLock releases all the held advisory locks. ReleaseLock(ctx context.Context) error // GetWarmingReadsPercent gets the percentage of queries to clone to replicas for bufferpool warming GetWarmingReadsPercent() int // GetWarmingReadsChannel returns the channel for executing warming reads against replicas GetWarmingReadsChannel() chan bool // CloneForReplicaWarming clones the VCursor for re-use in warming queries to replicas CloneForReplicaWarming(ctx context.Context) VCursor }
VCursor defines the interface the engine will use to execute routes.
type VExplain ¶
type VExplain struct { Input Primitive Type sqlparser.VExplainType }
func (*VExplain) CachedSize ¶
func (*VExplain) GetFields ¶
func (v *VExplain) GetFields(ctx context.Context, vcursor VCursor, bindVars map[string]*querypb.BindVariable) (*sqltypes.Result, error)
GetFields implements the Primitive interface
func (*VExplain) GetKeyspaceName ¶
GetKeyspaceName implements the Primitive interface
func (*VExplain) GetTableName ¶
GetTableName implements the Primitive interface
func (*VExplain) NeedsTransaction ¶
NeedsTransaction implements the Primitive interface
type VStream ¶
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 ¶
func (*VStream) GetFields ¶
func (v *VStream) GetFields(ctx context.Context, vcursor VCursor, bindVars map[string]*querypb.BindVariable) (*sqltypes.Result, error)
GetFields implements the Primitive interface
func (*VStream) GetKeyspaceName ¶
GetKeyspaceName implements the Primitive interface
func (*VStream) GetTableName ¶
GetTableName implements the Primitive interface
func (VStream) NeedsTransaction ¶
func (VStream) NeedsTransaction() bool
type Verify ¶
Verify contains the verification primitve and its type i.e. parent or child
func (*Verify) CachedSize ¶
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 evalengine.Expr // contains filtered or unexported fields }
VindexFunc is a primitive that performs vindex functions.
func (*VindexFunc) CachedSize ¶
func (cached *VindexFunc) CachedSize(alloc bool) int64
func (*VindexFunc) GetFields ¶
func (vf *VindexFunc) GetFields(ctx context.Context, 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 ¶
func (vf *VindexFunc) TryExecute(ctx context.Context, vcursor VCursor, bindVars map[string]*querypb.BindVariable, wantfields bool) (*sqltypes.Result, error)
TryExecute performs a non-streaming exec.
func (*VindexFunc) TryStreamExecute ¶
func (vf *VindexFunc) TryStreamExecute(ctx context.Context, vcursor VCursor, bindVars map[string]*querypb.BindVariable, wantfields bool, callback func(*sqltypes.Result) error) error
TryStreamExecute performs a streaming exec.
type VindexLookup ¶
type VindexLookup struct { Opcode Opcode // The vindex to use to do the Map Vindex vindexes.LookupPlanable // Keyspace specifies the keyspace to send the query to. Keyspace *vindexes.Keyspace Arguments []string // Values specifies the vindex values to use for routing. Values []evalengine.Expr // We fetch data in order to do the map from this primitive Lookup Primitive // This is the side that needs to be routed SendTo *Route }
func (*VindexLookup) CachedSize ¶
func (cached *VindexLookup) CachedSize(alloc bool) int64
func (*VindexLookup) GetFields ¶
func (vr *VindexLookup) GetFields(ctx context.Context, vcursor VCursor, bindVars map[string]*querypb.BindVariable) (*sqltypes.Result, error)
GetFields implements the Primitive interface
func (*VindexLookup) GetKeyspaceName ¶
func (vr *VindexLookup) GetKeyspaceName() string
GetKeyspaceName implements the Primitive interface
func (*VindexLookup) GetTableName ¶
func (vr *VindexLookup) GetTableName() string
GetTableName implements the Primitive interface
func (*VindexLookup) Inputs ¶
func (vr *VindexLookup) Inputs() ([]Primitive, []map[string]any)
Inputs implements the Primitive interface
func (*VindexLookup) NeedsTransaction ¶
func (vr *VindexLookup) NeedsTransaction() bool
NeedsTransaction implements the Primitive interface
func (*VindexLookup) RouteType ¶
func (vr *VindexLookup) RouteType() string
RouteType implements the Primitive interface
func (*VindexLookup) TryExecute ¶
func (vr *VindexLookup) TryExecute(ctx context.Context, vcursor VCursor, bindVars map[string]*querypb.BindVariable, wantfields bool) (*sqltypes.Result, error)
TryExecute implements the Primitive interface
func (*VindexLookup) TryStreamExecute ¶
func (vr *VindexLookup) TryStreamExecute(ctx context.Context, vcursor VCursor, bindVars map[string]*querypb.BindVariable, wantfields bool, callback func(*sqltypes.Result) error) error
TryStreamExecute implements the Primitive interface
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 { EvalExprMap map[string]evalengine.Expr Offset int // Offset from ownedVindexQuery to provide input decision for vindex update. }
VindexValues contains changed values for a vindex.
func (*VindexValues) CachedSize ¶
func (cached *VindexValues) CachedSize(alloc bool) int64
type VitessMetadata ¶
type VitessMetadata struct {
Name, Value string
}
VitessMetadata implements the SetOp interface and will write the changes variable into the topo server
func (*VitessMetadata) CachedSize ¶
func (cached *VitessMetadata) CachedSize(alloc bool) int64
func (*VitessMetadata) Execute ¶
func (v *VitessMetadata) Execute(ctx context.Context, vcursor VCursor, env *evalengine.ExpressionEnv) error
func (*VitessMetadata) VariableName ¶
func (v *VitessMetadata) VariableName() string
Source Files
¶
- aggregations.go
- cached_size.go
- concatenate.go
- dbddl.go
- dbddl_plugin.go
- ddl.go
- delete.go
- distinct.go
- dml.go
- dml_with_input.go
- exec_prepared_statement.go
- filter.go
- fk_cascade.go
- fk_verify.go
- hash_join.go
- insert.go
- insert_common.go
- insert_select.go
- join.go
- limit.go
- lock.go
- memory_sort.go
- merge_sort.go
- mstream.go
- online_ddl.go
- ordered_aggregate.go
- plan.go
- plan_description.go
- primitive.go
- projection.go
- rename_fields.go
- replace_variables.go
- revert_migration.go
- route.go
- routing.go
- rows.go
- scalar_aggregation.go
- semi_join.go
- send.go
- sequential.go
- session_primitive.go
- set.go
- shard_route.go
- show_exec.go
- simple_projection.go
- singlerow.go
- sql_calc_found_rows.go
- throttle_app.go
- uncorrelated_subquery.go
- unlock.go
- update.go
- update_target.go
- upsert.go
- vexplain.go
- vindex_func.go
- vindex_lookup.go
- vschema_ddl.go
- vstream.go