Versions in this module Expand all Collapse all v1 v1.3.0 Nov 28, 2021 Changes in this version + const EncodedSeqLength + const MaxBytesLen + var ErrArgument = errors.Register(ormCodespace, 112, "invalid argument") + var ErrEmptyKey = errors.Register(ormCodespace, 114, "cannot use empty key") + var ErrIndexKeyMaxLength = errors.Register(ormCodespace, 113, "index key exceeds max length") + var ErrIteratorDone = errors.Register(ormCodespace, 101, "iterator done") + var ErrIteratorInvalid = errors.Register(ormCodespace, 102, "iterator invalid") + var ErrNotFound = errors.Register(ormCodespace, 100, "not found") + var ErrType = errors.Register(ormCodespace, 110, "invalid type") + var ErrUniqueConstraint = errors.Register(ormCodespace, 111, "unique constraint violation") + func AddLengthPrefix(bytes []byte) []byte + func DecodeSequence(bz []byte) uint64 + func EncodeSequence(val uint64) []byte + func NullTerminatedBytes(s string) []byte + func Paginate(it Iterator, pageRequest *query.PageRequest, dest ModelSlicePtr) (*query.PageResponse, error) + func PrefixRange(prefix []byte) ([]byte, []byte) + func PrimaryKey(obj PrimaryKeyed) []byte + func TestTableBuilder(prefixData byte, storeKey sdk.StoreKey, model codec.ProtoMarshaler, ...) (*tableBuilder, error) + type AfterDeleteInterceptor func(ctx HasKVStore, rowID RowID, value codec.ProtoMarshaler) error + type AfterSetInterceptor func(ctx HasKVStore, rowID RowID, newValue, oldValue codec.ProtoMarshaler) error + type AlwaysPanicKVStore struct + func (a AlwaysPanicKVStore) CacheWrap() types.CacheWrap + func (a AlwaysPanicKVStore) CacheWrapWithTrace(w io.Writer, tc types.TraceContext) types.CacheWrap + func (a AlwaysPanicKVStore) Delete(key []byte) + func (a AlwaysPanicKVStore) Get(key []byte) []byte + func (a AlwaysPanicKVStore) GetStoreType() types.StoreType + func (a AlwaysPanicKVStore) Has(key []byte) bool + func (a AlwaysPanicKVStore) Iterator(start, end []byte) types.Iterator + func (a AlwaysPanicKVStore) ReverseIterator(start, end []byte) types.Iterator + func (a AlwaysPanicKVStore) Set(key, value []byte) + type AutoUInt64Table struct + func (a AutoUInt64Table) Create(ctx HasKVStore, obj codec.ProtoMarshaler) (uint64, error) + func (a AutoUInt64Table) Delete(ctx HasKVStore, rowID uint64) error + func (a AutoUInt64Table) Export(ctx HasKVStore, dest ModelSlicePtr) (uint64, error) + func (a AutoUInt64Table) GetOne(ctx HasKVStore, rowID uint64, dest codec.ProtoMarshaler) (RowID, error) + func (a AutoUInt64Table) Has(ctx HasKVStore, rowID uint64) bool + func (a AutoUInt64Table) Import(ctx HasKVStore, data interface{}, seqValue uint64) error + func (a AutoUInt64Table) PrefixScan(ctx HasKVStore, start, end uint64) (Iterator, error) + func (a AutoUInt64Table) ReversePrefixScan(ctx HasKVStore, start uint64, end uint64) (Iterator, error) + func (a AutoUInt64Table) Sequence() Sequence + func (a AutoUInt64Table) Set(ctx HasKVStore, rowID uint64, newValue codec.ProtoMarshaler) error + func (a AutoUInt64Table) Update(ctx HasKVStore, rowID uint64, newValue codec.ProtoMarshaler) error + type AutoUInt64TableBuilder struct + func NewAutoUInt64TableBuilder(prefixData byte, prefixSeq byte, storeKey sdk.StoreKey, ...) (*AutoUInt64TableBuilder, error) + func (a AutoUInt64TableBuilder) AddAfterDeleteInterceptor(interceptor AfterDeleteInterceptor) + func (a AutoUInt64TableBuilder) AddAfterSetInterceptor(interceptor AfterSetInterceptor) + func (a AutoUInt64TableBuilder) Build() AutoUInt64Table + func (a AutoUInt64TableBuilder) RowGetter() RowGetter + func (a AutoUInt64TableBuilder) StoreKey() sdk.StoreKey + type GasCountingMockContext struct + GasMeter sdk.GasMeter + func NewGasCountingMockContext(parent HasKVStore) *GasCountingMockContext + func (g *GasCountingMockContext) ResetGasMeter() + func (g GasCountingMockContext) GasConsumed() types.Gas + func (g GasCountingMockContext) KVStore(key sdk.StoreKey) sdk.KVStore + type HasKVStore interface + KVStore func(key sdk.StoreKey) sdk.KVStore + type Index interface + Get func(ctx HasKVStore, searchKey interface{}) (Iterator, error) + GetPaginated func(ctx HasKVStore, searchKey interface{}, pageRequest *query.PageRequest) (Iterator, error) + Has func(ctx HasKVStore, key interface{}) (bool, error) + PrefixScan func(ctx HasKVStore, startI interface{}, endI interface{}) (Iterator, error) + ReversePrefixScan func(ctx HasKVStore, startI interface{}, endI interface{}) (Iterator, error) + type Indexable interface + AddAfterDeleteInterceptor func(interceptor AfterDeleteInterceptor) + AddAfterSetInterceptor func(interceptor AfterSetInterceptor) + RowGetter func() RowGetter + StoreKey func() sdk.StoreKey + type Indexer struct + func NewIndexer(indexerFunc IndexerFunc) (*Indexer, error) + func NewUniqueIndexer(f UniqueIndexerFunc) (*Indexer, error) + func (i Indexer) IndexerFunc() IndexerFunc + func (i Indexer) OnCreate(store sdk.KVStore, rowID RowID, value interface{}) error + func (i Indexer) OnDelete(store sdk.KVStore, rowID RowID, value interface{}) error + func (i Indexer) OnUpdate(store sdk.KVStore, rowID RowID, newValue, oldValue interface{}) error + type IndexerFunc func(value interface{}) ([]interface{}, error) + type Iterator interface + LoadNext func(dest codec.ProtoMarshaler) (RowID, error) + func NewInvalidIterator() Iterator + func NewSingleValueIterator(rowID RowID, val []byte) Iterator + type IteratorFunc func(dest codec.ProtoMarshaler) (RowID, error) + func (i IteratorFunc) Close() error + func (i IteratorFunc) LoadNext(dest codec.ProtoMarshaler) (RowID, error) + type LimitedIterator struct + func LimitIterator(parent Iterator, max int) (*LimitedIterator, error) + func (i *LimitedIterator) LoadNext(dest codec.ProtoMarshaler) (RowID, error) + func (i LimitedIterator) Close() error + type MockContext struct + func NewMockContext() *MockContext + func (m MockContext) KVStore(key sdk.StoreKey) sdk.KVStore + type ModelSlicePtr interface + type MultiKeyIndex struct + func NewIndex(builder Indexable, prefix byte, indexerF IndexerFunc, indexKey interface{}) (MultiKeyIndex, error) + func (i MultiKeyIndex) Get(ctx HasKVStore, searchKey interface{}) (Iterator, error) + func (i MultiKeyIndex) GetPaginated(ctx HasKVStore, searchKey interface{}, pageRequest *query.PageRequest) (Iterator, error) + func (i MultiKeyIndex) Has(ctx HasKVStore, key interface{}) (bool, error) + func (i MultiKeyIndex) PrefixScan(ctx HasKVStore, startI interface{}, endI interface{}) (Iterator, error) + func (i MultiKeyIndex) ReversePrefixScan(ctx HasKVStore, startI interface{}, endI interface{}) (Iterator, error) + type Persistent interface + Marshal func() ([]byte, error) + Unmarshal func([]byte) error + type PrimaryKeyTable struct + func (a PrimaryKeyTable) Contains(ctx HasKVStore, obj PrimaryKeyed) bool + func (a PrimaryKeyTable) Create(ctx HasKVStore, obj PrimaryKeyed) error + func (a PrimaryKeyTable) Delete(ctx HasKVStore, obj PrimaryKeyed) error + func (a PrimaryKeyTable) Export(ctx HasKVStore, dest ModelSlicePtr) (uint64, error) + func (a PrimaryKeyTable) GetOne(ctx HasKVStore, primKey RowID, dest codec.ProtoMarshaler) error + func (a PrimaryKeyTable) Has(ctx HasKVStore, primaryKey RowID) bool + func (a PrimaryKeyTable) Import(ctx HasKVStore, data interface{}, seqValue uint64) error + func (a PrimaryKeyTable) PrefixScan(ctx HasKVStore, start, end []byte) (Iterator, error) + func (a PrimaryKeyTable) ReversePrefixScan(ctx HasKVStore, start, end []byte) (Iterator, error) + func (a PrimaryKeyTable) Set(ctx HasKVStore, newValue PrimaryKeyed) error + func (a PrimaryKeyTable) Update(ctx HasKVStore, newValue PrimaryKeyed) error + type PrimaryKeyTableBuilder struct + func NewPrimaryKeyTableBuilder(prefixData byte, storeKey sdk.StoreKey, model PrimaryKeyed, cdc codec.Codec) (*PrimaryKeyTableBuilder, error) + func (a PrimaryKeyTableBuilder) AddAfterDeleteInterceptor(interceptor AfterDeleteInterceptor) + func (a PrimaryKeyTableBuilder) AddAfterSetInterceptor(interceptor AfterSetInterceptor) + func (a PrimaryKeyTableBuilder) Build() PrimaryKeyTable + func (a PrimaryKeyTableBuilder) RowGetter() RowGetter + func (a PrimaryKeyTableBuilder) StoreKey() sdk.StoreKey + type PrimaryKeyed interface + PrimaryKeyFields func() []interface{} + type RowGetter func(ctx HasKVStore, rowID RowID, dest codec.ProtoMarshaler) error + func NewTypeSafeRowGetter(storeKey sdk.StoreKey, prefixKey byte, model reflect.Type, cdc codec.Codec) RowGetter + type RowID []byte + func First(it Iterator, dest codec.ProtoMarshaler) (RowID, error) + func ReadAll(it Iterator, dest ModelSlicePtr) ([]RowID, error) + func (r RowID) Bytes() []byte + type Sequence struct + func NewSequence(storeKey sdk.StoreKey, prefix byte) Sequence + func (s Sequence) CurVal(ctx HasKVStore) uint64 + func (s Sequence) InitVal(ctx HasKVStore, seq uint64) error + func (s Sequence) NextVal(ctx HasKVStore) uint64 + func (s Sequence) PeekNextVal(ctx HasKVStore) uint64 + type TableExportable interface + Export func(HasKVStore, ModelSlicePtr) (uint64, error) + Import func(HasKVStore, interface{}, uint64) error + type UniqueIndex struct + func NewUniqueIndex(builder Indexable, prefix byte, uniqueIndexerFunc UniqueIndexerFunc, ...) (UniqueIndex, error) + type UniqueIndexerFunc func(value interface{}) (interface{}, error) + type Validateable interface + ValidateBasic func() error