Documentation ¶
Index ¶
- func BoundedTableFromMeta(alloc autoid.Allocator, tblInfo *model.TableInfo, capacity int64) table.Table
- func FindIndexByColName(t table.Table, name string) table.Index
- func MemoryTableFromMeta(alloc autoid.Allocator, tblInfo *model.TableInfo) (table.Table, error)
- func MockTableFromMeta(tableInfo *model.TableInfo) table.Table
- func NewIndex(tableInfo *model.TableInfo, indexInfo *model.IndexInfo) table.Index
- func TableFromMeta(alloc autoid.Allocator, tblInfo *model.TableInfo) (table.Table, error)
- type BoundedTable
- func (t *BoundedTable) AddRecord(ctx context.Context, r []types.Datum) (int64, error)
- func (t *BoundedTable) AllocAutoID() (int64, error)
- func (t *BoundedTable) Allocator() autoid.Allocator
- func (t *BoundedTable) Cols() []*table.Column
- func (t *BoundedTable) FirstKey() kv.Key
- func (t *BoundedTable) IndexPrefix() kv.Key
- func (t *BoundedTable) Indices() []table.Index
- func (t *BoundedTable) IterRecords(ctx context.Context, startKey kv.Key, cols []*table.Column, ...) error
- func (t *BoundedTable) Meta() *model.TableInfo
- func (t *BoundedTable) RebaseAutoID(newBase int64, isSetStep bool) error
- func (t *BoundedTable) RecordKey(h int64) kv.Key
- func (t *BoundedTable) RecordPrefix() kv.Key
- func (t *BoundedTable) RemoveRecord(ctx context.Context, h int64, r []types.Datum) error
- func (t *BoundedTable) Row(ctx context.Context, h int64) ([]types.Datum, error)
- func (t *BoundedTable) RowWithCols(ctx context.Context, h int64, cols []*table.Column) ([]types.Datum, error)
- func (t *BoundedTable) Seek(ctx context.Context, handle int64) (int64, bool, error)
- func (t *BoundedTable) Truncate()
- func (t *BoundedTable) UpdateRecord(ctx context.Context, h int64, oldData []types.Datum, newData []types.Datum, ...) error
- func (t *BoundedTable) WritableCols() []*table.Column
- type MemoryTable
- func (t *MemoryTable) AddRecord(ctx context.Context, r []types.Datum) (recordID int64, err error)
- func (t *MemoryTable) AllocAutoID() (int64, error)
- func (t *MemoryTable) Allocator() autoid.Allocator
- func (t *MemoryTable) Cols() []*table.Column
- func (t *MemoryTable) FirstKey() kv.Key
- func (t *MemoryTable) IndexPrefix() kv.Key
- func (t *MemoryTable) Indices() []table.Index
- func (t *MemoryTable) IterRecords(ctx context.Context, startKey kv.Key, cols []*table.Column, ...) error
- func (t *MemoryTable) Meta() *model.TableInfo
- func (t *MemoryTable) RebaseAutoID(newBase int64, isSetStep bool) error
- func (t *MemoryTable) RecordKey(h int64) kv.Key
- func (t *MemoryTable) RecordPrefix() kv.Key
- func (t *MemoryTable) RemoveRecord(ctx context.Context, h int64, r []types.Datum) error
- func (t *MemoryTable) Row(ctx context.Context, h int64) ([]types.Datum, error)
- func (t *MemoryTable) RowWithCols(ctx context.Context, h int64, cols []*table.Column) ([]types.Datum, error)
- func (t *MemoryTable) Seek(ctx context.Context, handle int64) (int64, bool, error)
- func (t *MemoryTable) Truncate()
- func (t *MemoryTable) UpdateRecord(ctx context.Context, h int64, oldData []types.Datum, newData []types.Datum, ...) error
- func (t *MemoryTable) WritableCols() []*table.Column
- type Table
- func (t *Table) AddRecord(ctx context.Context, r []types.Datum) (recordID int64, err error)
- func (t *Table) AllocAutoID() (int64, error)
- func (t *Table) Allocator() autoid.Allocator
- func (t *Table) Cols() []*table.Column
- func (t *Table) FirstKey() kv.Key
- func (t *Table) IndexPrefix() kv.Key
- func (t *Table) Indices() []table.Index
- func (t *Table) IterRecords(ctx context.Context, startKey kv.Key, cols []*table.Column, ...) error
- func (t *Table) Meta() *model.TableInfo
- func (t *Table) RebaseAutoID(newBase int64, isSetStep bool) error
- func (t *Table) RecordKey(h int64) kv.Key
- func (t *Table) RecordPrefix() kv.Key
- func (t *Table) RemoveRecord(ctx context.Context, h int64, r []types.Datum) error
- func (t *Table) Row(ctx context.Context, h int64) ([]types.Datum, error)
- func (t *Table) RowWithCols(ctx context.Context, h int64, cols []*table.Column) ([]types.Datum, error)
- func (t *Table) Seek(ctx context.Context, h int64) (int64, bool, error)
- func (t *Table) UpdateRecord(ctx context.Context, h int64, oldData []types.Datum, newData []types.Datum, ...) error
- func (t *Table) WritableCols() []*table.Column
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BoundedTableFromMeta ¶
func BoundedTableFromMeta(alloc autoid.Allocator, tblInfo *model.TableInfo, capacity int64) table.Table
BoundedTableFromMeta creates a Table instance from model.TableInfo.
func FindIndexByColName ¶
FindIndexByColName implements table.Table FindIndexByColName interface.
func MemoryTableFromMeta ¶
MemoryTableFromMeta creates a Table instance from model.TableInfo.
func MockTableFromMeta ¶
MockTableFromMeta only serves for test.
Types ¶
type BoundedTable ¶
type BoundedTable struct { ID int64 Name model.CIStr Columns []*table.Column // contains filtered or unexported fields }
BoundedTable implements table.Table interface.
func (*BoundedTable) AllocAutoID ¶
func (t *BoundedTable) AllocAutoID() (int64, error)
AllocAutoID implements table.Table AllocAutoID interface.
func (*BoundedTable) Allocator ¶
func (t *BoundedTable) Allocator() autoid.Allocator
Allocator implements table.Table Allocator interface.
func (*BoundedTable) Cols ¶
func (t *BoundedTable) Cols() []*table.Column
Cols implements table.Table Cols interface.
func (*BoundedTable) FirstKey ¶
func (t *BoundedTable) FirstKey() kv.Key
FirstKey implements table.Table FirstKey interface.
func (*BoundedTable) IndexPrefix ¶
func (t *BoundedTable) IndexPrefix() kv.Key
IndexPrefix implements table.Table IndexPrefix interface.
func (*BoundedTable) Indices ¶
func (t *BoundedTable) Indices() []table.Index
Indices implements table.Table Indices interface.
func (*BoundedTable) IterRecords ¶
func (t *BoundedTable) IterRecords(ctx context.Context, startKey kv.Key, cols []*table.Column, fn table.RecordIterFunc) error
IterRecords implements table.Table IterRecords interface.
func (*BoundedTable) Meta ¶
func (t *BoundedTable) Meta() *model.TableInfo
Meta implements table.Table Meta interface.
func (*BoundedTable) RebaseAutoID ¶
func (t *BoundedTable) RebaseAutoID(newBase int64, isSetStep bool) error
RebaseAutoID implements table.Table RebaseAutoID interface.
func (*BoundedTable) RecordKey ¶
func (t *BoundedTable) RecordKey(h int64) kv.Key
RecordKey implements table.Table RecordKey interface.
func (*BoundedTable) RecordPrefix ¶
func (t *BoundedTable) RecordPrefix() kv.Key
RecordPrefix implements table.Table RecordPrefix interface.
func (*BoundedTable) RemoveRecord ¶
RemoveRecord implements table.Table RemoveRecord interface.
func (*BoundedTable) RowWithCols ¶
func (t *BoundedTable) RowWithCols(ctx context.Context, h int64, cols []*table.Column) ([]types.Datum, error)
RowWithCols implements table.Table RowWithCols interface.
func (*BoundedTable) Truncate ¶
func (t *BoundedTable) Truncate()
Truncate drops all data in BoundedTable.
func (*BoundedTable) UpdateRecord ¶
func (t *BoundedTable) UpdateRecord(ctx context.Context, h int64, oldData []types.Datum, newData []types.Datum, touched map[int]bool) error
UpdateRecord implements table.Table UpdateRecord interface.
func (*BoundedTable) WritableCols ¶
func (t *BoundedTable) WritableCols() []*table.Column
WritableCols implements table.Table WritableCols interface.
type MemoryTable ¶
type MemoryTable struct { ID int64 Name model.CIStr Columns []*table.Column // contains filtered or unexported fields }
MemoryTable implements table.Table interface.
func (*MemoryTable) AllocAutoID ¶
func (t *MemoryTable) AllocAutoID() (int64, error)
AllocAutoID implements table.Table AllocAutoID interface.
func (*MemoryTable) Allocator ¶
func (t *MemoryTable) Allocator() autoid.Allocator
Allocator implements table.Table Allocator interface.
func (*MemoryTable) Cols ¶
func (t *MemoryTable) Cols() []*table.Column
Cols implements table.Table Cols interface.
func (*MemoryTable) FirstKey ¶
func (t *MemoryTable) FirstKey() kv.Key
FirstKey implements table.Table FirstKey interface.
func (*MemoryTable) IndexPrefix ¶
func (t *MemoryTable) IndexPrefix() kv.Key
IndexPrefix implements table.Table IndexPrefix interface.
func (*MemoryTable) Indices ¶
func (t *MemoryTable) Indices() []table.Index
Indices implements table.Table Indices interface.
func (*MemoryTable) IterRecords ¶
func (t *MemoryTable) IterRecords(ctx context.Context, startKey kv.Key, cols []*table.Column, fn table.RecordIterFunc) error
IterRecords implements table.Table IterRecords interface.
func (*MemoryTable) Meta ¶
func (t *MemoryTable) Meta() *model.TableInfo
Meta implements table.Table Meta interface.
func (*MemoryTable) RebaseAutoID ¶
func (t *MemoryTable) RebaseAutoID(newBase int64, isSetStep bool) error
RebaseAutoID implements table.Table RebaseAutoID interface.
func (*MemoryTable) RecordKey ¶
func (t *MemoryTable) RecordKey(h int64) kv.Key
RecordKey implements table.Table RecordKey interface.
func (*MemoryTable) RecordPrefix ¶
func (t *MemoryTable) RecordPrefix() kv.Key
RecordPrefix implements table.Table RecordPrefix interface.
func (*MemoryTable) RemoveRecord ¶
RemoveRecord implements table.Table RemoveRecord interface.
func (*MemoryTable) RowWithCols ¶
func (t *MemoryTable) RowWithCols(ctx context.Context, h int64, cols []*table.Column) ([]types.Datum, error)
RowWithCols implements table.Table RowWithCols interface.
func (*MemoryTable) Truncate ¶
func (t *MemoryTable) Truncate()
Truncate drops all data in Memory Table.
func (*MemoryTable) UpdateRecord ¶
func (t *MemoryTable) UpdateRecord(ctx context.Context, h int64, oldData []types.Datum, newData []types.Datum, touched map[int]bool) error
UpdateRecord implements table.Table UpdateRecord interface.
func (*MemoryTable) WritableCols ¶
func (t *MemoryTable) WritableCols() []*table.Column
WritableCols implements table.Table WritableCols interface.
type Table ¶
type Table struct { ID int64 Name model.CIStr Columns []*table.Column // contains filtered or unexported fields }
Table implements table.Table interface.
func (*Table) AllocAutoID ¶
AllocAutoID implements table.Table AllocAutoID interface.
func (*Table) IndexPrefix ¶
IndexPrefix implements table.Table IndexPrefix interface.
func (*Table) IterRecords ¶
func (t *Table) IterRecords(ctx context.Context, startKey kv.Key, cols []*table.Column, fn table.RecordIterFunc) error
IterRecords implements table.Table IterRecords interface.
func (*Table) RebaseAutoID ¶
RebaseAutoID implements table.Table RebaseAutoID interface.
func (*Table) RecordPrefix ¶
RecordPrefix implements table.Table RecordPrefix interface.
func (*Table) RemoveRecord ¶
RemoveRecord implements table.Table RemoveRecord interface.
func (*Table) RowWithCols ¶
func (t *Table) RowWithCols(ctx context.Context, h int64, cols []*table.Column) ([]types.Datum, error)
RowWithCols implements table.Table RowWithCols interface.
func (*Table) UpdateRecord ¶
func (t *Table) UpdateRecord(ctx context.Context, h int64, oldData []types.Datum, newData []types.Datum, touched map[int]bool) error
UpdateRecord implements table.Table UpdateRecord interface.
func (*Table) WritableCols ¶
WritableCols implements table WritableCols interface.