Versions in this module Expand all Collapse all v0 v0.16.3 Nov 29, 2024 Changes in this version + const TypeReference + const TypeSequence + var TabletTypeSuffix = map[topodatapb.TabletType]string + func ChooseVindexForType(typ querypb.Type) (string, error) + func LoadFormal(filename string) (*vschemapb.SrvVSchema, error) + func LoadFormalKeyspace(filename string) (*vschemapb.Keyspace, error) + func Map(vindex Vindex, vcursor VCursor, rowsColValues [][]sqltypes.Value) ([]key.Destination, error) + func Register(vindexType string, newVindexFunc NewVindexFunc) + func ValidateKeyspace(input *vschemapb.Keyspace) error + func Verify(vindex Vindex, vcursor VCursor, rowsColValues [][]sqltypes.Value, ...) ([]bool, error) + type AutoIncrement struct + Column sqlparser.ColIdent + Sequence *Table + type Binary struct + func (*Binary) ReverseMap(_ VCursor, ksids [][]byte) ([]sqltypes.Value, error) + func (vind *Binary) Cost() int + func (vind *Binary) IsUnique() bool + func (vind *Binary) Map(cursor VCursor, ids []sqltypes.Value) ([]key.Destination, error) + func (vind *Binary) NeedsVCursor() bool + func (vind *Binary) String() string + func (vind *Binary) Verify(_ VCursor, ids []sqltypes.Value, ksids [][]byte) ([]bool, error) + type BinaryMD5 struct + func (vind *BinaryMD5) Cost() int + func (vind *BinaryMD5) IsUnique() bool + func (vind *BinaryMD5) Map(cursor VCursor, ids []sqltypes.Value) ([]key.Destination, error) + func (vind *BinaryMD5) NeedsVCursor() bool + func (vind *BinaryMD5) String() string + func (vind *BinaryMD5) Verify(_ VCursor, ids []sqltypes.Value, ksids [][]byte) ([]bool, error) + type ByCost []*ColumnVindex + func (bc ByCost) Len() int + func (bc ByCost) Less(i, j int) bool + func (bc ByCost) Swap(i, j int) + type Column struct + Name sqlparser.ColIdent + Type querypb.Type + func (col *Column) MarshalJSON() ([]byte, error) + type ColumnVindex struct + Columns []sqlparser.ColIdent + Name string + Owned bool + Type string + Vindex Vindex + func FindBestColVindex(table *Table) (*ColumnVindex, error) + func FindVindexForSharding(tableName string, colVindexes []*ColumnVindex) (*ColumnVindex, error) + type ConsistentLookup struct + func (lu *ConsistentLookup) Cost() int + func (lu *ConsistentLookup) IsUnique() bool + func (lu *ConsistentLookup) Map(vcursor VCursor, ids []sqltypes.Value) ([]key.Destination, error) + func (lu *ConsistentLookup) NeedsVCursor() bool + func (lu ConsistentLookup) Create(vcursor VCursor, rowsColValues [][]sqltypes.Value, ksids [][]byte, ...) error + func (lu ConsistentLookup) Delete(vcursor VCursor, rowsColValues [][]sqltypes.Value, ksid []byte) error + func (lu ConsistentLookup) MarshalJSON() ([]byte, error) + func (lu ConsistentLookup) SetOwnerInfo(keyspace, table string, cols []sqlparser.ColIdent) error + func (lu ConsistentLookup) String() string + func (lu ConsistentLookup) Update(vcursor VCursor, oldValues []sqltypes.Value, ksid []byte, ...) error + func (lu ConsistentLookup) Verify(vcursor VCursor, ids []sqltypes.Value, ksids [][]byte) ([]bool, error) + type ConsistentLookupUnique struct + func (lu *ConsistentLookupUnique) Cost() int + func (lu *ConsistentLookupUnique) IsUnique() bool + func (lu *ConsistentLookupUnique) Map(vcursor VCursor, ids []sqltypes.Value) ([]key.Destination, error) + func (lu *ConsistentLookupUnique) NeedsVCursor() bool + func (lu ConsistentLookupUnique) Create(vcursor VCursor, rowsColValues [][]sqltypes.Value, ksids [][]byte, ...) error + func (lu ConsistentLookupUnique) Delete(vcursor VCursor, rowsColValues [][]sqltypes.Value, ksid []byte) error + func (lu ConsistentLookupUnique) MarshalJSON() ([]byte, error) + func (lu ConsistentLookupUnique) SetOwnerInfo(keyspace, table string, cols []sqlparser.ColIdent) error + func (lu ConsistentLookupUnique) String() string + func (lu ConsistentLookupUnique) Update(vcursor VCursor, oldValues []sqltypes.Value, ksid []byte, ...) error + func (lu ConsistentLookupUnique) Verify(vcursor VCursor, ids []sqltypes.Value, ksids [][]byte) ([]bool, error) + type Hash struct + func (vind *Hash) Cost() int + func (vind *Hash) IsUnique() bool + func (vind *Hash) Map(cursor VCursor, ids []sqltypes.Value) ([]key.Destination, error) + func (vind *Hash) NeedsVCursor() bool + func (vind *Hash) ReverseMap(_ VCursor, ksids [][]byte) ([]sqltypes.Value, error) + func (vind *Hash) String() string + func (vind *Hash) Verify(_ VCursor, ids []sqltypes.Value, ksids [][]byte) ([]bool, error) + type Keyspace struct + Name string + Sharded bool + type KeyspaceSchema struct + Error error + Keyspace *Keyspace + Tables map[string]*Table + Vindexes map[string]Vindex + func BuildKeyspaceSchema(input *vschemapb.Keyspace, keyspace string) (*KeyspaceSchema, error) + func (ks *KeyspaceSchema) MarshalJSON() ([]byte, error) + type Lookup interface + Create func(vc VCursor, rowsColValues [][]sqltypes.Value, ksids [][]byte, ignoreMode bool) error + Delete func(vc VCursor, rowsColValues [][]sqltypes.Value, ksid []byte) error + Update func(vc VCursor, oldValues []sqltypes.Value, ksid []byte, ...) error + type LookupHash struct + func (lh *LookupHash) Cost() int + func (lh *LookupHash) Create(vcursor VCursor, rowsColValues [][]sqltypes.Value, ksids [][]byte, ...) error + func (lh *LookupHash) Delete(vcursor VCursor, rowsColValues [][]sqltypes.Value, ksid []byte) error + func (lh *LookupHash) IsUnique() bool + func (lh *LookupHash) Map(vcursor VCursor, ids []sqltypes.Value) ([]key.Destination, error) + func (lh *LookupHash) MarshalJSON() ([]byte, error) + func (lh *LookupHash) NeedsVCursor() bool + func (lh *LookupHash) String() string + func (lh *LookupHash) Update(vcursor VCursor, oldValues []sqltypes.Value, ksid []byte, ...) error + func (lh *LookupHash) Verify(vcursor VCursor, ids []sqltypes.Value, ksids [][]byte) ([]bool, error) + type LookupHashUnique struct + func (lhu *LookupHashUnique) Cost() int + func (lhu *LookupHashUnique) Create(vcursor VCursor, rowsColValues [][]sqltypes.Value, ksids [][]byte, ...) error + func (lhu *LookupHashUnique) Delete(vcursor VCursor, rowsColValues [][]sqltypes.Value, ksid []byte) error + func (lhu *LookupHashUnique) IsUnique() bool + func (lhu *LookupHashUnique) Map(vcursor VCursor, ids []sqltypes.Value) ([]key.Destination, error) + func (lhu *LookupHashUnique) MarshalJSON() ([]byte, error) + func (lhu *LookupHashUnique) NeedsVCursor() bool + func (lhu *LookupHashUnique) String() string + func (lhu *LookupHashUnique) Update(vcursor VCursor, oldValues []sqltypes.Value, ksid []byte, ...) error + func (lhu *LookupHashUnique) Verify(vcursor VCursor, ids []sqltypes.Value, ksids [][]byte) ([]bool, error) + type LookupNonUnique struct + func (ln *LookupNonUnique) Cost() int + func (ln *LookupNonUnique) Create(vcursor VCursor, rowsColValues [][]sqltypes.Value, ksids [][]byte, ...) error + func (ln *LookupNonUnique) Delete(vcursor VCursor, rowsColValues [][]sqltypes.Value, ksid []byte) error + func (ln *LookupNonUnique) IsUnique() bool + func (ln *LookupNonUnique) Map(vcursor VCursor, ids []sqltypes.Value) ([]key.Destination, error) + func (ln *LookupNonUnique) MarshalJSON() ([]byte, error) + func (ln *LookupNonUnique) NeedsVCursor() bool + func (ln *LookupNonUnique) String() string + func (ln *LookupNonUnique) Update(vcursor VCursor, oldValues []sqltypes.Value, ksid []byte, ...) error + func (ln *LookupNonUnique) Verify(vcursor VCursor, ids []sqltypes.Value, ksids [][]byte) ([]bool, error) + type LookupUnicodeLooseMD5Hash struct + func (lh *LookupUnicodeLooseMD5Hash) Cost() int + func (lh *LookupUnicodeLooseMD5Hash) Create(vcursor VCursor, rowsColValues [][]sqltypes.Value, ksids [][]byte, ...) error + func (lh *LookupUnicodeLooseMD5Hash) Delete(vcursor VCursor, rowsColValues [][]sqltypes.Value, ksid []byte) error + func (lh *LookupUnicodeLooseMD5Hash) IsUnique() bool + func (lh *LookupUnicodeLooseMD5Hash) Map(vcursor VCursor, ids []sqltypes.Value) ([]key.Destination, error) + func (lh *LookupUnicodeLooseMD5Hash) MarshalJSON() ([]byte, error) + func (lh *LookupUnicodeLooseMD5Hash) NeedsVCursor() bool + func (lh *LookupUnicodeLooseMD5Hash) String() string + func (lh *LookupUnicodeLooseMD5Hash) Update(vcursor VCursor, oldValues []sqltypes.Value, ksid []byte, ...) error + func (lh *LookupUnicodeLooseMD5Hash) Verify(vcursor VCursor, ids []sqltypes.Value, ksids [][]byte) ([]bool, error) + type LookupUnicodeLooseMD5HashUnique struct + func (lhu *LookupUnicodeLooseMD5HashUnique) Cost() int + func (lhu *LookupUnicodeLooseMD5HashUnique) Create(vcursor VCursor, rowsColValues [][]sqltypes.Value, ksids [][]byte, ...) error + func (lhu *LookupUnicodeLooseMD5HashUnique) Delete(vcursor VCursor, rowsColValues [][]sqltypes.Value, ksid []byte) error + func (lhu *LookupUnicodeLooseMD5HashUnique) IsUnique() bool + func (lhu *LookupUnicodeLooseMD5HashUnique) Map(vcursor VCursor, ids []sqltypes.Value) ([]key.Destination, error) + func (lhu *LookupUnicodeLooseMD5HashUnique) MarshalJSON() ([]byte, error) + func (lhu *LookupUnicodeLooseMD5HashUnique) NeedsVCursor() bool + func (lhu *LookupUnicodeLooseMD5HashUnique) String() string + func (lhu *LookupUnicodeLooseMD5HashUnique) Update(vcursor VCursor, oldValues []sqltypes.Value, ksid []byte, ...) error + func (lhu *LookupUnicodeLooseMD5HashUnique) Verify(vcursor VCursor, ids []sqltypes.Value, ksids [][]byte) ([]bool, error) + type LookupUnique struct + func (lu *LookupUnique) Cost() int + func (lu *LookupUnique) Create(vcursor VCursor, rowsColValues [][]sqltypes.Value, ksids [][]byte, ...) error + func (lu *LookupUnique) Delete(vcursor VCursor, rowsColValues [][]sqltypes.Value, ksid []byte) error + func (lu *LookupUnique) IsUnique() bool + func (lu *LookupUnique) Map(vcursor VCursor, ids []sqltypes.Value) ([]key.Destination, error) + func (lu *LookupUnique) MarshalJSON() ([]byte, error) + func (lu *LookupUnique) NeedsVCursor() bool + func (lu *LookupUnique) String() string + func (lu *LookupUnique) Update(vcursor VCursor, oldValues []sqltypes.Value, ksid []byte, ...) error + func (lu *LookupUnique) Verify(vcursor VCursor, ids []sqltypes.Value, ksids [][]byte) ([]bool, error) + type MultiColumn interface + Map func(vcursor VCursor, rowsColValues [][]sqltypes.Value) ([]key.Destination, error) + Verify func(vcursor VCursor, rowsColValues [][]sqltypes.Value, ksids [][]byte) ([]bool, error) + type NewVindexFunc func(string, map[string]string) (Vindex, error) + type Null struct + func (vind *Null) Cost() int + func (vind *Null) IsUnique() bool + func (vind *Null) Map(cursor VCursor, ids []sqltypes.Value) ([]key.Destination, error) + func (vind *Null) NeedsVCursor() bool + func (vind *Null) String() string + func (vind *Null) Verify(cursor VCursor, ids []sqltypes.Value, ksids [][]byte) ([]bool, error) + type Numeric struct + func (*Numeric) Cost() int + func (*Numeric) IsUnique() bool + func (*Numeric) Map(cursor VCursor, ids []sqltypes.Value) ([]key.Destination, error) + func (*Numeric) NeedsVCursor() bool + func (*Numeric) ReverseMap(_ VCursor, ksids [][]byte) ([]sqltypes.Value, error) + func (*Numeric) Verify(_ VCursor, ids []sqltypes.Value, ksids [][]byte) ([]bool, error) + func (vind *Numeric) String() string + type NumericLookupTable map[uint64]uint64 + type NumericStaticMap struct + func (*NumericStaticMap) Cost() int + func (vind *NumericStaticMap) IsUnique() bool + func (vind *NumericStaticMap) Map(cursor VCursor, ids []sqltypes.Value) ([]key.Destination, error) + func (vind *NumericStaticMap) NeedsVCursor() bool + func (vind *NumericStaticMap) String() string + func (vind *NumericStaticMap) Verify(_ VCursor, ids []sqltypes.Value, ksids [][]byte) ([]bool, error) + type RegionExperimental struct + func (ge *RegionExperimental) Cost() int + func (ge *RegionExperimental) IsUnique() bool + func (ge *RegionExperimental) Map(vcursor VCursor, rowsColValues [][]sqltypes.Value) ([]key.Destination, error) + func (ge *RegionExperimental) NeedsVCursor() bool + func (ge *RegionExperimental) String() string + func (ge *RegionExperimental) Verify(vcursor VCursor, rowsColValues [][]sqltypes.Value, ksids [][]byte) ([]bool, error) + type RegionJson struct + func (rv *RegionJson) Cost() int + func (rv *RegionJson) IsUnique() bool + func (rv *RegionJson) Map(vcursor VCursor, rowsColValues [][]sqltypes.Value) ([]key.Destination, error) + func (rv *RegionJson) NeedsVCursor() bool + func (rv *RegionJson) String() string + func (rv *RegionJson) Verify(vcursor VCursor, rowsColValues [][]sqltypes.Value, ksids [][]byte) ([]bool, error) + type RegionMap map[string]uint64 + type ReverseBits struct + func (vind *ReverseBits) Cost() int + func (vind *ReverseBits) IsUnique() bool + func (vind *ReverseBits) Map(cursor VCursor, ids []sqltypes.Value) ([]key.Destination, error) + func (vind *ReverseBits) NeedsVCursor() bool + func (vind *ReverseBits) ReverseMap(_ VCursor, ksids [][]byte) ([]sqltypes.Value, error) + func (vind *ReverseBits) String() string + func (vind *ReverseBits) Verify(_ VCursor, ids []sqltypes.Value, ksids [][]byte) ([]bool, error) + type Reversible interface + ReverseMap func(vcursor VCursor, ks [][]byte) ([]sqltypes.Value, error) + type RoutingRule struct + Error error + Tables []*Table + func (rr *RoutingRule) MarshalJSON() ([]byte, error) + type SingleColumn interface + Map func(vcursor VCursor, ids []sqltypes.Value) ([]key.Destination, error) + Verify func(vcursor VCursor, ids []sqltypes.Value, ksids [][]byte) ([]bool, error) + type Table struct + AutoIncrement *AutoIncrement + ColumnListAuthoritative bool + ColumnVindexes []*ColumnVindex + Columns []Column + Keyspace *Keyspace + Name sqlparser.TableIdent + Ordered []*ColumnVindex + Owned []*ColumnVindex + Pinned []byte + Type string + type UnicodeLooseMD5 struct + func (vind *UnicodeLooseMD5) Cost() int + func (vind *UnicodeLooseMD5) IsUnique() bool + func (vind *UnicodeLooseMD5) Map(cursor VCursor, ids []sqltypes.Value) ([]key.Destination, error) + func (vind *UnicodeLooseMD5) NeedsVCursor() bool + func (vind *UnicodeLooseMD5) String() string + func (vind *UnicodeLooseMD5) Verify(_ VCursor, ids []sqltypes.Value, ksids [][]byte) ([]bool, error) + type VCursor interface + Execute func(method string, query string, bindvars map[string]*querypb.BindVariable, ...) (*sqltypes.Result, error) + ExecuteKeyspaceID func(keyspace string, ksid []byte, query string, ...) (*sqltypes.Result, error) + type VSchema struct + Keyspaces map[string]*KeyspaceSchema + RoutingRules map[string]*RoutingRule + func BuildVSchema(source *vschemapb.SrvVSchema) (vschema *VSchema, err error) + func (vschema *VSchema) FindTable(keyspace, tablename string) (*Table, error) + func (vschema *VSchema) FindTablesOrVindex(keyspace, name string, tabletType topodatapb.TabletType) ([]*Table, Vindex, error) + func (vschema *VSchema) FindVindex(keyspace, name string) (Vindex, error) + type Vindex interface + Cost func() int + IsUnique func() bool + NeedsVCursor func() bool + String func() string + func CreateVindex(vindexType, name string, params map[string]string) (Vindex, error) + func NewBinary(name string, _ map[string]string) (Vindex, error) + func NewBinaryMD5(name string, _ map[string]string) (Vindex, error) + func NewConsistentLookup(name string, m map[string]string) (Vindex, error) + func NewConsistentLookupUnique(name string, m map[string]string) (Vindex, error) + func NewHash(name string, m map[string]string) (Vindex, error) + func NewLookup(name string, m map[string]string) (Vindex, error) + func NewLookupHash(name string, m map[string]string) (Vindex, error) + func NewLookupHashUnique(name string, m map[string]string) (Vindex, error) + func NewLookupUnicodeLooseMD5Hash(name string, m map[string]string) (Vindex, error) + func NewLookupUnicodeLooseMD5HashUnique(name string, m map[string]string) (Vindex, error) + func NewLookupUnique(name string, m map[string]string) (Vindex, error) + func NewNull(name string, m map[string]string) (Vindex, error) + func NewNumeric(name string, _ map[string]string) (Vindex, error) + func NewNumericStaticMap(name string, params map[string]string) (Vindex, error) + func NewRegionExperimental(name string, m map[string]string) (Vindex, error) + func NewRegionJson(name string, m map[string]string) (Vindex, error) + func NewReverseBits(name string, m map[string]string) (Vindex, error) + func NewUnicodeLooseMD5(name string, _ map[string]string) (Vindex, error) + func NewXXHash(name string, m map[string]string) (Vindex, error) + type WantOwnerInfo interface + SetOwnerInfo func(keyspace, table string, cols []sqlparser.ColIdent) error + type XXHash struct + func (vind *XXHash) Cost() int + func (vind *XXHash) IsUnique() bool + func (vind *XXHash) Map(cursor VCursor, ids []sqltypes.Value) ([]key.Destination, error) + func (vind *XXHash) NeedsVCursor() bool + func (vind *XXHash) String() string + func (vind *XXHash) Verify(_ VCursor, ids []sqltypes.Value, ksids [][]byte) ([]bool, error)