tables

package
v0.0.0-...-6c7ef32 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 26, 2019 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func TableFromMeta

func TableFromMeta(dbname string, alloc autoid.Allocator, tblInfo *model.TableInfo) table.Table

TableFromMeta creates a Table instance from model.TableInfo.

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) AddRecord

func (t *Table) AddRecord(ctx context.Context, r []interface{}) (recordID int64, err error)

AddRecord implements table.Table AddRecord interface.

func (*Table) AllocAutoID

func (t *Table) AllocAutoID() (int64, error)

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) Cols

func (t *Table) Cols() []*column.Col

Cols implements table.Table Cols interface.

func (*Table) DecodeValue

func (t *Table) DecodeValue(data []byte, col *column.Col) (interface{}, error)

DecodeValue implements table.Table DecodeValue interface.

func (*Table) EncodeValue

func (t *Table) EncodeValue(raw interface{}) ([]byte, error)

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) FirstKey

func (t *Table) FirstKey() string

FirstKey implements table.Table FirstKey interface.

func (*Table) IndexPrefix

func (t *Table) IndexPrefix() string

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) KeyPrefix

func (t *Table) KeyPrefix() string

KeyPrefix implements table.Table KeyPrefix interface.

func (*Table) LockRow

func (t *Table) LockRow(ctx context.Context, h int64, update bool) error

LockRow implements table.Table LockRow interface.

func (*Table) Meta

func (t *Table) Meta() *model.TableInfo

Meta implements table.Table Meta interface.

func (*Table) RecordKey

func (t *Table) RecordKey(h int64, col *column.Col) []byte

RecordKey implements table.Table RecordKey interface.

func (*Table) RemoveRow

func (t *Table) RemoveRow(ctx context.Context, h int64) error

RemoveRow implements table.Table RemoveRow interface.

func (*Table) RemoveRowAllIndex

func (t *Table) RemoveRowAllIndex(ctx context.Context, h int64, rec []interface{}) error

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) Row

func (t *Table) Row(ctx context.Context, h int64) ([]interface{}, error)

Row implements table.Table Row interface.

func (*Table) RowWithCols

func (t *Table) RowWithCols(ctx context.Context, h int64, cols []*column.Col) ([]interface{}, error)

RowWithCols implements table.Table RowWithCols interface.

func (*Table) TableID

func (t *Table) TableID() int64

TableID implements table.Table TableID interface.

func (*Table) TableName

func (t *Table) TableName() model.CIStr

TableName implements table.Table TableName interface.

func (*Table) Truncate

func (t *Table) Truncate(ctx context.Context) (err error)

Truncate implements table.Table Truncate interface.

func (*Table) UpdateRecord

func (t *Table) UpdateRecord(ctx context.Context, h int64, currData []interface{}, newData []interface{}, touched []bool) error

UpdateRecord implements table.Table UpdateRecord interface.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL