Documentation ¶
Index ¶
- func TableFromMeta(dbname string, alloc autoid.Allocator, tblInfo *model.TableInfo) table.Table
- type Table
- func (t *Table) AddIndex(idxCol *column.IndexedCol)
- func (t *Table) AddRecord(ctx context.Context, r []interface{}) (recordID int64, err error)
- func (t *Table) AllocAutoID() (int64, error)
- func (t *Table) BuildIndexForRow(ctx context.Context, h int64, vals []interface{}, idx *column.IndexedCol) error
- func (t *Table) Cols() []*column.Col
- func (t *Table) DecodeValue(data []byte, col *column.Col) (interface{}, error)
- func (t *Table) EncodeValue(raw interface{}) ([]byte, error)
- func (t *Table) FindIndexByColName(name string) *column.IndexedCol
- func (t *Table) FirstKey() string
- func (t *Table) IndexPrefix() string
- func (t *Table) Indices() []*column.IndexedCol
- func (t *Table) IterRecords(ctx context.Context, startKey string, cols []*column.Col, ...) error
- func (t *Table) KeyPrefix() string
- func (t *Table) LockRow(ctx context.Context, h int64, update bool) error
- func (t *Table) Meta() *model.TableInfo
- func (t *Table) RecordKey(h int64, col *column.Col) []byte
- func (t *Table) RemoveRow(ctx context.Context, h int64) error
- func (t *Table) RemoveRowAllIndex(ctx context.Context, h int64, rec []interface{}) error
- func (t *Table) RemoveRowIndex(ctx context.Context, h int64, vals []interface{}, idx *column.IndexedCol) error
- func (t *Table) Row(ctx context.Context, h int64) ([]interface{}, error)
- func (t *Table) RowWithCols(ctx context.Context, h int64, cols []*column.Col) ([]interface{}, error)
- func (t *Table) TableID() int64
- func (t *Table) TableName() model.CIStr
- func (t *Table) Truncate(ctx context.Context) (err error)
- func (t *Table) UpdateRecord(ctx context.Context, h int64, currData []interface{}, newData []interface{}, ...) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Table ¶
type Table struct { ID int64 Name model.CIStr Columns []*column.Col // contains filtered or unexported fields }
Table implements table.Table interface.
func NewTable ¶
func NewTable(tableID int64, tableName string, dbName string, cols []*column.Col, alloc autoid.Allocator) *Table
NewTable constructs a Table instance.
func (*Table) AddIndex ¶
func (t *Table) AddIndex(idxCol *column.IndexedCol)
AddIndex implements table.Table AddIndex interface.
func (*Table) AllocAutoID ¶
AllocAutoID implements table.Table AllocAutoID interface.
func (*Table) BuildIndexForRow ¶
func (t *Table) BuildIndexForRow(ctx context.Context, h int64, vals []interface{}, idx *column.IndexedCol) error
BuildIndexForRow implements table.Table BuildIndexForRow interface.
func (*Table) DecodeValue ¶
DecodeValue implements table.Table DecodeValue interface.
func (*Table) EncodeValue ¶
EncodeValue implements table.Table EncodeValue interface.
func (*Table) FindIndexByColName ¶
func (t *Table) FindIndexByColName(name string) *column.IndexedCol
FindIndexByColName implements table.Table FindIndexByColName interface.
func (*Table) IndexPrefix ¶
IndexPrefix implements table.Table IndexPrefix interface.
func (*Table) Indices ¶
func (t *Table) Indices() []*column.IndexedCol
Indices implements table.Table Indices interface.
func (*Table) IterRecords ¶
func (t *Table) IterRecords(ctx context.Context, startKey string, cols []*column.Col, fn table.RecordIterFunc) error
IterRecords implements table.Table IterRecords interface.
func (*Table) RemoveRowAllIndex ¶
RemoveRowAllIndex implements table.Table RemoveRowAllIndex interface.
func (*Table) RemoveRowIndex ¶
func (t *Table) RemoveRowIndex(ctx context.Context, h int64, vals []interface{}, idx *column.IndexedCol) error
RemoveRowIndex implements table.Table RemoveRowIndex interface.
func (*Table) RowWithCols ¶
func (t *Table) RowWithCols(ctx context.Context, h int64, cols []*column.Col) ([]interface{}, error)
RowWithCols implements table.Table RowWithCols interface.