Versions in this module Expand all Collapse all v6 v6.4.0 May 18, 2020 Changes in this version + const Add + const Del + const None + const Update + var ErrDupPrimaryKey = errors.New("ErrDupPrimaryKey") + var ErrEmptyPrimaryKey = errors.New("ErrEmptyPrimaryKey") + var ErrIndexKey = errors.New("ErrIndexKey") + var ErrNilValue = errors.New("ErrNilValue") + var ErrPrimaryKey = errors.New("ErrPrimaryKey") + var ErrTablePrefixOrTableName = errors.New("ErrTablePrefixOrTableName") + var ErrTooManyIndex = errors.New("ErrTooManyIndex") + func DecodeRow(data []byte) ([]byte, []byte, error) + func JoinKey(leftvalue, rightvalue []byte) []byte + type Count struct + func NewCount(prefix string, name string, kvdb db.KV) *Count + func (c *Count) Dec() (num int64, err error) + func (c *Count) Get() (int64, error) + func (c *Count) Inc() (num int64, err error) + func (c *Count) Save() (kvs []*types.KeyValue, err error) + func (c *Count) Set(i int64) + type JoinData struct + Left types.Message + Right types.Message + func (msg *JoinData) ProtoMessage() + func (msg *JoinData) Reset() + func (msg *JoinData) String() string + type JoinMeta struct + func (tx *JoinMeta) CreateRow() *Row + func (tx *JoinMeta) Get(key string) ([]byte, error) + func (tx *JoinMeta) SetPayload(data types.Message) error + type JoinTable struct + Fk string + func NewJoinTable(left *Table, right *Table, indexes []string) (*JoinTable, error) + func (join *JoinTable) GetData(primaryKey []byte) (*Row, error) + func (join *JoinTable) GetLeft() *Table + func (join *JoinTable) GetRight() *Table + func (join *JoinTable) GetTable(name string) (*Table, error) + func (join *JoinTable) ListIndex(indexName string, prefix []byte, primaryKey []byte, count, direction int32) (rows []*Row, err error) + func (join *JoinTable) MustGetTable(name string) *Table + func (join *JoinTable) Save() (kvs []*types.KeyValue, err error) + type Option struct + Index []string + Join bool + Name string + Prefix string + Primary string + type Query struct + func (query *Query) List(indexName string, data types.Message, primaryKey []byte, ...) (rows []*Row, err error) + func (query *Query) ListIndex(indexName string, prefix []byte, primaryKey []byte, count, direction int32) (rows []*Row, err error) + func (query *Query) ListOne(indexName string, data types.Message, primaryKey []byte) (row *Row, err error) + type Row struct + Data types.Message + Primary []byte + Ty int + func (row *Row) Encode() ([]byte, error) + type RowMeta interface + CreateRow func() *Row + Get func(key string) ([]byte, error) + SetPayload func(types.Message) error + type Table struct + func NewTable(rowmeta RowMeta, kvdb db.KV, opt *Option) (*Table, error) + func (table *Table) Add(data types.Message) error + func (table *Table) Del(primaryKey []byte) error + func (table *Table) DelRow(data types.Message) error + func (table *Table) GetData(primaryKey []byte) (*Row, error) + func (table *Table) GetMeta() RowMeta + func (table *Table) GetQuery(kvdb db.KVDB) *Query + func (table *Table) ListIndex(indexName string, prefix []byte, primaryKey []byte, count, direction int32) (rows []*Row, err error) + func (table *Table) Replace(data types.Message) error + func (table *Table) Save() (kvs []*types.KeyValue, err error) + func (table *Table) Update(primaryKey []byte, newdata types.Message) (err error) Other modules containing this package github.com/33cn/chain33