Versions in this module Expand all Collapse all v0 v0.1.0 Sep 20, 2026 Changes in this version + var ErrNotFound = fmt.Errorf("not found") + var MapType = reflect.MapOf(reflect.TypeOf(""), reflect.TypeOf("")).Kind() + func All(it ResultIterator) iter.Seq[interface{}] + func AllOf[T any](it ResultIterator) iter.Seq[T] + func IsIntType(k reflect.Kind) (size int, okay bool) + func IsUintType(k reflect.Kind) (size int, okay bool) + type BitmapIndex struct + Indexer Indexer + func (b *BitmapIndex) FromArgs(args ...interface{}) ([]byte, error) + func (b *BitmapIndex) FromObject(obj interface{}) (bool, [][]byte, error) + func (b *BitmapIndex) PrefixFromArgs(args ...interface{}) ([]byte, error) + type BoolFieldIndex struct + Field string + func (i *BoolFieldIndex) FromArgs(args ...interface{}) ([]byte, error) + func (i *BoolFieldIndex) FromObject(obj interface{}) (bool, []byte, error) + type BoolIndex struct + Get func(*T) bool + func (b *BoolIndex[T]) FromArgs(args ...interface{}) ([]byte, error) + func (b *BoolIndex[T]) FromObject(obj interface{}) (bool, []byte, error) + type Change struct + After interface{} + Before interface{} + Table string + func (m *Change) Created() bool + func (m *Change) Deleted() bool + func (m *Change) Updated() bool + type Changes []Change + type CompoundIndex struct + AllowMissing bool + Indexes []Indexer + func (c *CompoundIndex) FromArgs(args ...interface{}) ([]byte, error) + func (c *CompoundIndex) FromObject(raw interface{}) (bool, []byte, error) + func (c *CompoundIndex) PrefixFromArgs(args ...interface{}) ([]byte, error) + type CompoundMultiIndex struct + AllowMissing bool + Indexes []Indexer + func (c *CompoundMultiIndex) FromArgs(args ...interface{}) ([]byte, error) + func (c *CompoundMultiIndex) FromObject(raw interface{}) (bool, [][]byte, error) + type ConditionalIndex struct + Conditional ConditionalIndexFunc + func (c *ConditionalIndex) FromArgs(args ...interface{}) ([]byte, error) + func (c *ConditionalIndex) FromObject(obj interface{}) (bool, []byte, error) + type ConditionalIndexFunc func(obj interface{}) (bool, error) + type DBSchema struct + Tables map[string]*TableSchema + func (s *DBSchema) Validate() error + type FieldSetIndex struct + Field string + func (f *FieldSetIndex) FromArgs(args ...interface{}) ([]byte, error) + func (f *FieldSetIndex) FromObject(obj interface{}) (bool, []byte, error) + type FilterFunc func(interface{}) bool + type FilterIterator struct + func NewFilterIterator(iter ResultIterator, filter FilterFunc) *FilterIterator + func (f *FilterIterator) Next() interface{} + func (f *FilterIterator) WatchCh() <-chan struct{} + type IndexSchema struct + AllowMissing bool + Indexer Indexer + Name string + Unique bool + func (s *IndexSchema) Validate() error + type Indexer interface + FromArgs func(args ...interface{}) ([]byte, error) + type IntFieldIndex struct + Field string + func (i *IntFieldIndex) FromArgs(args ...interface{}) ([]byte, error) + func (i *IntFieldIndex) FromObject(obj interface{}) (bool, []byte, error) + type IntIndex struct + Get func(*T) N + func (i *IntIndex[T, N]) FromArgs(args ...interface{}) ([]byte, error) + func (i *IntIndex[T, N]) FromObject(obj interface{}) (bool, []byte, error) + type IntKey struct + func IntKeyOf[N signedInt, T any](t Table[T], index string) *IntKey[T, N] + func (k *IntKey[T, N]) First(txn *Txn, key N) (*T, error) + func (k *IntKey[T, N]) Get(txn *Txn, key N) (Rows[T], error) + func (k *IntKey[T, N]) LowerBound(txn *Txn, key N) (Rows[T], error) + type MemDB struct + func NewMemDB(schema *DBSchema) (*MemDB, error) + func (db *MemDB) DBSchema() *DBSchema + func (db *MemDB) Snapshot() *MemDB + func (db *MemDB) Txn(write bool) *Txn + type MultiIndexer interface + FromObject func(raw interface{}) (bool, [][]byte, error) + type PrefixIndexer interface + PrefixFromArgs func(args ...interface{}) ([]byte, error) + type ResultIterator interface + Next func() interface{} + WatchCh func() <-chan struct{} + type RowSet struct + func (s RowSet) All() iter.Seq[interface{}] + func (s RowSet) And(others ...RowSet) RowSet + func (s RowSet) AndNot(others ...RowSet) RowSet + func (s RowSet) Iterator() ResultIterator + func (s RowSet) Len() int + func (s RowSet) Or(others ...RowSet) RowSet + type Rows struct + func (r Rows[T]) All() iter.Seq[*T] + func (r Rows[T]) Next() *T + func (r Rows[T]) WatchCh() <-chan struct{} + type SingleIndexer interface + FromObject func(raw interface{}) (bool, []byte, error) + type StringFieldIndex struct + Field string + Lowercase bool + func (s *StringFieldIndex) FromArgs(args ...interface{}) ([]byte, error) + func (s *StringFieldIndex) FromObject(obj interface{}) (bool, []byte, error) + func (s *StringFieldIndex) PrefixFromArgs(args ...interface{}) ([]byte, error) + type StringIndex struct + Get func(*T) string + Lowercase bool + func (s *StringIndex[T]) FromArgs(args ...interface{}) ([]byte, error) + func (s *StringIndex[T]) FromObject(obj interface{}) (bool, []byte, error) + func (s *StringIndex[T]) PrefixFromArgs(args ...interface{}) ([]byte, error) + type StringKey struct + func (k *StringKey[T]) First(txn *Txn, key string) (*T, error) + func (k *StringKey[T]) FirstPrefix(txn *Txn, prefix string) (*T, error) + func (k *StringKey[T]) Get(txn *Txn, key string) (Rows[T], error) + func (k *StringKey[T]) GetPrefix(txn *Txn, prefix string) (Rows[T], error) + type StringMapFieldIndex struct + Field string + Lowercase bool + func (s *StringMapFieldIndex) FromArgs(args ...interface{}) ([]byte, error) + func (s *StringMapFieldIndex) FromObject(obj interface{}) (bool, [][]byte, error) + type StringSliceFieldIndex struct + Field string + Lowercase bool + func (s *StringSliceFieldIndex) FromArgs(args ...interface{}) ([]byte, error) + func (s *StringSliceFieldIndex) FromObject(obj interface{}) (bool, [][]byte, error) + func (s *StringSliceFieldIndex) PrefixFromArgs(args ...interface{}) ([]byte, error) + type StringSliceIndex struct + Get func(*T) []string + Lowercase bool + func (s *StringSliceIndex[T]) FromArgs(args ...interface{}) ([]byte, error) + func (s *StringSliceIndex[T]) FromObject(obj interface{}) (bool, [][]byte, error) + func (s *StringSliceIndex[T]) PrefixFromArgs(args ...interface{}) ([]byte, error) + type Table struct + func NewTable[T any](name string) Table[T] + func (t Table[T]) Delete(txn *Txn, obj *T) error + func (t Table[T]) First(txn *Txn, index string, args ...interface{}) (*T, error) + func (t Table[T]) FirstWatch(txn *Txn, index string, args ...interface{}) (<-chan struct{}, *T, error) + func (t Table[T]) Get(txn *Txn, index string, args ...interface{}) (Rows[T], error) + func (t Table[T]) GetReverse(txn *Txn, index string, args ...interface{}) (Rows[T], error) + func (t Table[T]) Insert(txn *Txn, obj *T) error + func (t Table[T]) Last(txn *Txn, index string, args ...interface{}) (*T, error) + func (t Table[T]) LowerBound(txn *Txn, index string, args ...interface{}) (Rows[T], error) + func (t Table[T]) Name() string + func (t Table[T]) ReverseLowerBound(txn *Txn, index string, args ...interface{}) (Rows[T], error) + func (t Table[T]) StringKey(index string) *StringKey[T] + type TableSchema struct + Indexes map[string]*IndexSchema + Name string + func (s *TableSchema) Validate() error + type Txn struct + func (txn *Txn) Abort() + func (txn *Txn) AllRows(table string) (RowSet, error) + func (txn *Txn) Changes() Changes + func (txn *Txn) Commit() + func (txn *Txn) Defer(fn func()) + func (txn *Txn) Delete(table string, obj interface{}) error + func (txn *Txn) DeleteAll(table, index string, args ...interface{}) (int, error) + func (txn *Txn) DeletePrefix(table string, prefix_index string, prefix string) (bool, error) + func (txn *Txn) First(table, index string, args ...interface{}) (interface{}, error) + func (txn *Txn) FirstWatch(table, index string, args ...interface{}) (<-chan struct{}, interface{}, error) + func (txn *Txn) Get(table, index string, args ...interface{}) (ResultIterator, error) + func (txn *Txn) GetReverse(table, index string, args ...interface{}) (ResultIterator, error) + func (txn *Txn) Insert(table string, obj interface{}) error + func (txn *Txn) Last(table, index string, args ...interface{}) (interface{}, error) + func (txn *Txn) LastWatch(table, index string, args ...interface{}) (<-chan struct{}, interface{}, error) + func (txn *Txn) LongestPrefix(table, index string, args ...interface{}) (interface{}, error) + func (txn *Txn) LowerBound(table, index string, args ...interface{}) (ResultIterator, error) + func (txn *Txn) ReverseLowerBound(table, index string, args ...interface{}) (ResultIterator, error) + func (txn *Txn) Snapshot() *Txn + func (txn *Txn) TrackChanges() + func (txn *Txn) Where(table, index string, args ...interface{}) (RowSet, error) + func (txn *Txn) WhereWatch(table, index string, args ...interface{}) (<-chan struct{}, RowSet, error) + type UUIDFieldIndex struct + Field string + func (u *UUIDFieldIndex) FromArgs(args ...interface{}) ([]byte, error) + func (u *UUIDFieldIndex) FromObject(obj interface{}) (bool, []byte, error) + func (u *UUIDFieldIndex) PrefixFromArgs(args ...interface{}) ([]byte, error) + type UintFieldIndex struct + Field string + func (u *UintFieldIndex) FromArgs(args ...interface{}) ([]byte, error) + func (u *UintFieldIndex) FromObject(obj interface{}) (bool, []byte, error) + type UintIndex struct + Get func(*T) N + func (u *UintIndex[T, N]) FromArgs(args ...interface{}) ([]byte, error) + func (u *UintIndex[T, N]) FromObject(obj interface{}) (bool, []byte, error) + type UintKey struct + func UintKeyOf[N unsignedInt, T any](t Table[T], index string) *UintKey[T, N] + func (k *UintKey[T, N]) First(txn *Txn, key N) (*T, error) + func (k *UintKey[T, N]) Get(txn *Txn, key N) (Rows[T], error) + func (k *UintKey[T, N]) LowerBound(txn *Txn, key N) (Rows[T], error) + type WatchSet map[<-chan struct{}]struct + func NewWatchSet() WatchSet + func (w WatchSet) Add(watchCh <-chan struct{}) + func (w WatchSet) AddWithLimit(softLimit int, watchCh <-chan struct{}, altCh <-chan struct{}) + func (w WatchSet) Watch(timeoutCh <-chan time.Time) bool + func (w WatchSet) WatchCh(ctx context.Context) <-chan error + func (w WatchSet) WatchCtx(ctx context.Context) error