Documentation
¶
Overview ¶
Package edb implements a document database on top of a key-value store (in this case, on top of Bolt).
We implement:
1. Tables, collection of arbitrary documents marshaled from the given struct.
2. Indices, allowing quick lookup of table data by custom values.
3. Maps, exposing raw key-value buckets with string keys and untyped values.
4. Singleton Keys, allowing to store a typed value for a given key within a map (say, a “config” value in a “globals” map).
Technical Details ¶
**Buckets.** We rely on scoped namespaces for keys called buckets. Bolt supports them natively. A flat database like Redis could simulate buckets via key prefixes. We use nested buckets in Bolt, but only for conveninece; flat buckets are fine.
**IndexDef ordinal** We assign a unique positive integer ordinal to each index. These values are never reused, even if an index is removed.
**TableDef states** We store a meta document per table, called “table state”. This document holds the information about which indexes are defined for the table, and assigns a (an ordinal) to each one. Ordinals are never reused as indexes are removed and added.
## Binary encoding
**Key encoding**. Keys are encoded using a _tuple encoding_.
**Value**: value header, then encoded data, then encoded index key records.
**Value header**: 1. Flags (uvarint). 2. Schema version (uvarint). 3. Data size (uvarint). 3. Index size (uvarint).
**Value data**: msgpack of the row struct.
**IndexDef key records** (inside a value) record the keys contributed by this row. If index computation changes in the future, we still need to know which index keys to delete when updating the row, so we store all index keys. Format: 1. Number of entries (uvarint). 2. For each entry: index ordinal (uvarint), key length (uvarint), key bytes.
Index ¶
- Constants
- Variables
- func All[Row any](c Cursor[Row]) []*Row
- func AllKeys[Key any](c RawCursor) []Key
- func AllLimited[Row any](c Cursor[Row], limit int) []*Row
- func AllRawKeys(c RawCursor) [][]byte
- func AllTableRows[Row any](txh Txish) []*Row
- func AllUntypedKeys(c RawCursor) []any
- func Count(c RawCursor) int
- func CountAll(txh Txish, tblArg AnyTable) int
- func DeleteAll(c RawCursor) int
- func DeleteByKey[Row any](txh Txish, key any) bool
- func DeleteRow[Row any](txh Txish, row *Row) bool
- func Exists[Row any](txh Txish, key any) bool
- func Filter[Row any](c Cursor[Row], f func(*Row) bool) []*Row
- func First[Row any](c Cursor[Row]) *Row
- func FirstKey[Key, Row any](c Cursor[Row]) Key
- func Get[Row any](txh Txish, key any) *Row
- func GetByKeyRaw[Row any](txh Txish, keyRaw []byte) *Row
- func IndexPrimaryKey[Key any](v values.Value) Key
- func Lookup[Row any](txh Txish, idxArg AnyIndex, indexKey any) *Row
- func LookupExists(txh Txish, idxArg AnyIndex, indexKey any) bool
- func LookupKey[Key any](txh Txish, idxArg AnyIndex, indexKey any) (Key, bool)
- func Memo[T any](txish Txish, key string, f func() (T, error)) (T, error)
- func Proto[T any]() any
- func Put(txh Txish, rows ...any) bool
- func PutByKey[Row any](txh Txish, key any, row *Row) bool
- func ReadChunks[S chunkScan[C], C scanChunk](db *DB, metadata TxMetadata, limit int, query func(*Tx) S) iter.Seq[C]
- func ReadReplicationStatus(path string) (uint64, error)
- func Reload[Row any](txh Txish, row *Row) *Row
- func SGet[T any](txh Txish, sk *SKey[T], v *T) bool
- func SGetRaw[T any](txh Txish, sk *SKey[T]) []byte
- func SPut[T any](txh Txish, sk *SKey[T], v *T)
- func SPutRaw[T any](txh Txish, sk *SKey[T], raw []byte)
- func Select[Row any](c Cursor[Row], f func(*Row) bool) *Row
- type AnyIndex
- type AnyTable
- type Change
- func (chg *Change) HasKey() bool
- func (chg *Change) HasNewGoStruct() bool
- func (chg *Change) HasNewRecord() bool
- func (chg *Change) HasOldGoStruct() bool
- func (chg *Change) HasOldRecord() bool
- func (chg *Change) Key() any
- func (chg *Change) KeyVal() reflect.Value
- func (chg *Change) NewGoStruct() any
- func (chg *Change) NewGoStructVal() reflect.Value
- func (chg *Change) NewRecord() kvo.Record
- func (chg *Change) OldGoStruct() any
- func (chg *Change) OldGoStructVal() reflect.Value
- func (chg *Change) OldRecord() kvo.Record
- func (chg *Change) Op() Op
- func (chg *Change) RawKey() []byte
- func (chg *Change) Table() *TableDef
- type ChangeFlags
- type Cursor
- func ExactIndexScan[Row any](txh Txish, idxArg AnyIndex, indexValue any) Cursor[Row]
- func ExactTableScan[Row any](txh Txish, value any) Cursor[Row]
- func FullIndexScan[Row any](txh Txish, idxArg AnyIndex) Cursor[Row]
- func FullReverseTableScan[Row any](txh Txish) Cursor[Row]
- func FullTableScan[Row any](txh Txish) Cursor[Row]
- func IndexScan[Row any](txh Txish, idxArg AnyIndex, opt ScanOptions) Cursor[Row]
- func PrefixIndexScan[Row any](txh Txish, idxArg AnyIndex, els int, indexValue any) Cursor[Row]
- func RangeIndexScan[Row any](txh Txish, idxArg AnyIndex, lowerValue, upperValue any, ...) Cursor[Row]
- func RangeTableScan[Row any](txh Txish, lowerValue, upperValue any, lowerInc, upperInc bool) Cursor[Row]
- func ReverseExactIndexScan[Row any](txh Txish, idxArg AnyIndex, indexValue any) Cursor[Row]
- func ReversePrefixIndexScan[Row any](txh Txish, idxArg AnyIndex, els int, indexValue any) Cursor[Row]
- func ReverseRangeIndexScan[Row any](txh Txish, idxArg AnyIndex, lowerValue, upperValue any, ...) Cursor[Row]
- func ReverseRangeTableScan[Row any](txh Txish, lowerValue, upperValue any, lowerInc, upperInc bool) Cursor[Row]
- func TableScan[Row any](txh Txish, opt ScanOptions) Cursor[Row]
- func (c Cursor[Row]) Key() any
- func (c Cursor[Row]) Meta() ValueMeta
- func (c Cursor[Row]) Next() bool
- func (c Cursor[Row]) Raw() RawCursor
- func (c Cursor[Row]) Record() kvo.Record
- func (c Cursor[Row]) RecordEdit() *RecordEdit
- func (c Cursor[Row]) Row() *Row
- func (c Cursor[Row]) RowInto(dst *Row) (ValueMeta, error)
- func (c Cursor[Row]) RowVal() (reflect.Value, ValueMeta)
- func (c Cursor[Row]) Rows() func(yield func(*Row) bool)
- func (c Cursor[Row]) TryRecord() (kvo.Record, ValueMeta, error)
- func (c Cursor[Row]) TryRecordEdit() (*RecordEdit, error)
- type DB
- func (db *DB) AllowsLocalWrites() bool
- func (db *DB) AllowsRowMigrations() bool
- func (db *DB) ApplyReplication(g *ReplicationGroup) error
- func (db *DB) BeginRead(metadata TxMetadata) (tx *Tx)
- func (db *DB) BeginUpdate(metadata TxMetadata) (tx *Tx)
- func (db *DB) Bolt() *bbolt.DB
- func (db *DB) Close()
- func (db *DB) CloseWithSafeToQuitCallback(safeToQuit func())
- func (db *DB) DescribeOpenTxns() string
- func (db *DB) IsClosed() bool
- func (db *DB) Read(metadata TxMetadata, f func(tx *Tx))
- func (db *DB) ReadErr(metadata TxMetadata, f func(tx *Tx) error) error
- func (db *DB) ReplicationPoisoned() (bool, error)
- func (db *DB) ReplicationStatus() (committedID uint64, err error)
- func (db *DB) Size() int64
- func (db *DB) Tx(metadata TxMetadata, writable bool, f func(tx *Tx) error) error
- func (db *DB) Write(metadata TxMetadata, f func(tx *Tx))
- type DataError
- type DumpFlags
- type FlatMarshaler
- type FlatMarshallable
- type FlatUnmarshaler
- type Index
- type IndexBuilder
- type IndexDef
- func (idx *IndexDef) DecodeIndexKeyVal(tup tuple) reflect.Value
- func (idx *IndexDef) DecodeIndexKeyValInto(keyVal reflect.Value, tup tuple)
- func (idx *IndexDef) DecodeKeyVal(rawKey []byte) reflect.Value
- func (idx *IndexDef) DecodeKeyValInto(keyVal reflect.Value, rawKey []byte)
- func (idx *IndexDef) EncodeKey(key any) []byte
- func (idx *IndexDef) EncodeKeyVal(keyVal reflect.Value) []byte
- func (idx *IndexDef) FullName() string
- func (i *IndexDef) IndexDef() *IndexDef
- func (idx *IndexDef) IsUnique() bool
- func (idx *IndexDef) KeyString(key any) string
- func (idx *IndexDef) ParseNakedIndexKey(s string) (any, error)
- func (idx *IndexDef) ParseNakedIndexKeyVal(s string) (reflect.Value, error)
- func (idx *IndexDef) RawKeyString(keyRaw []byte) string
- func (idx *IndexDef) ShortName() string
- func (idx *IndexDef) Table() *TableDef
- func (idx *IndexDef) TryDecodeKeyValInto(keyVal reflect.Value, rawKey []byte) error
- type IndexInitialFillMode
- type IndexOpt
- type IndexRow
- type KVCursor
- func (c *KVCursor) IndexKeys() func(yield func(k []byte) bool)
- func (c *KVCursor) Keys() func(yield func(k []byte) bool)
- func (c *KVCursor) Next() bool
- func (c *KVCursor) Object() fast1.ImmutableMap
- func (c *KVCursor) Objects() func(yield func(k []byte, o fast1.ImmutableMap) bool)
- func (c *KVCursor) RawIndexKey() []byte
- func (c *KVCursor) RawKey() []byte
- func (c *KVCursor) RawValue() []byte
- func (c *KVCursor) RawValues() func(yield func(k, v []byte) bool)
- type KVIndex
- type KVIndexContentBuilder
- type KVIndexKey
- type KVIndexKeyToPrimaryKey
- type KVIndexer
- type KVKey
- type KVMap
- type KVTable
- type KVTableBuilder
- type KeyCursor
- func (c *KeyCursor[Key]) Intersect(others ...*KeyCursor[Key]) *KeyCursor[Key]
- func (c *KeyCursor[Key]) Key() Key
- func (c *KeyCursor[Key]) Keys() iter.Seq[Key]
- func (c *KeyCursor[Key]) Next() bool
- func (c *KeyCursor[Key]) RawKey() []byte
- func (c *KeyCursor[Key]) Union(others ...*KeyCursor[Key]) *KeyCursor[Key]
- type LocalWriteMode
- type LocalWritePolicy
- type Op
- type Options
- type RawCursor
- type RawIndexCursor
- func (c *RawIndexCursor) Bookmark() ScanBookmark
- func (c *RawIndexCursor) IndexKey() any
- func (c *RawIndexCursor) Key() any
- func (c *RawIndexCursor) Meta() ValueMeta
- func (c *RawIndexCursor) Next() bool
- func (c *RawIndexCursor) RawKey() []byte
- func (c *RawIndexCursor) RawRow() []byte
- func (c *RawIndexCursor) Record() kvo.Record
- func (c *RawIndexCursor) RecordEdit() *RecordEdit
- func (c *RawIndexCursor) Row() (any, ValueMeta)
- func (c *RawIndexCursor) RowVal() (reflect.Value, ValueMeta)
- func (c *RawIndexCursor) Table() *TableDef
- func (c *RawIndexCursor) TryRecord() (kvo.Record, ValueMeta, error)
- func (c *RawIndexCursor) TryRecordEdit() (*RecordEdit, error)
- func (c *RawIndexCursor) TryRow() (any, ValueMeta, error)
- func (c *RawIndexCursor) TryRowVal() (reflect.Value, ValueMeta, error)
- func (c *RawIndexCursor) Tx() *Tx
- func (c *RawIndexCursor) UintKey() uint64
- func (c *RawIndexCursor) ValueMemento() []byte
- type RawRange
- func RawEE(l, u []byte) RawRange
- func RawEI(l, u []byte) RawRange
- func RawEO(l []byte) RawRange
- func RawIE(l, u []byte) RawRange
- func RawII(l, u []byte) RawRange
- func RawIO(l []byte) RawRange
- func RawOE(u []byte) RawRange
- func RawOI(u []byte) RawRange
- func RawOO() RawRange
- func RawPrefix(p []byte) RawRange
- type RawRangeCursor
- type RawTableCursor
- func (c *RawTableCursor) Bookmark() ScanBookmark
- func (c *RawTableCursor) Key() any
- func (c *RawTableCursor) Meta() ValueMeta
- func (c *RawTableCursor) Next() bool
- func (c *RawTableCursor) RawKey() []byte
- func (c *RawTableCursor) RawRow() []byte
- func (c *RawTableCursor) Record() kvo.Record
- func (c *RawTableCursor) RecordEdit() *RecordEdit
- func (c *RawTableCursor) Row() (any, ValueMeta)
- func (c *RawTableCursor) RowVal() (reflect.Value, ValueMeta)
- func (c *RawTableCursor) Table() *TableDef
- func (c *RawTableCursor) TryRecord() (kvo.Record, ValueMeta, error)
- func (c *RawTableCursor) TryRecordEdit() (*RecordEdit, error)
- func (c *RawTableCursor) TryRow() (any, ValueMeta, error)
- func (c *RawTableCursor) TryRowVal() (reflect.Value, ValueMeta, error)
- func (c *RawTableCursor) Tx() *Tx
- func (c *RawTableCursor) UintKey() uint64
- func (c *RawTableCursor) ValueMemento() []byte
- type RecordChunk
- func (c RecordChunk) Bookmark() ScanBookmark
- func (c RecordChunk) Count() int
- func (c RecordChunk) DBTx() *Tx
- func (c *RecordChunk[Key]) Entries() iter.Seq2[Key, kvo.Record]
- func (c *RecordChunk[Key]) Keys() iter.Seq[Key]
- func (c RecordChunk) More() bool
- func (c *RecordChunk[Key]) Records() iter.Seq[kvo.Record]
- func (c RecordChunk) Tx() *Tx
- type RecordEdit
- func (e *RecordEdit) Delete(p interface{ ... })
- func (e *RecordEdit) Edit(p *kvo.PropRef[kvo.Record]) *kvo.Editor
- func (e *RecordEdit) EditOrCreate(p *kvo.PropRef[kvo.Record]) *kvo.Editor
- func (e *RecordEdit) Editor() *kvo.Editor
- func (e *RecordEdit) Get[T any, P kvo.Property[T]](p P) T
- func (e *RecordEdit) Has(p interface{ ... }) bool
- func (e *RecordEdit) List[E any, P kvo.ListProperty[E]](p P) E
- func (e *RecordEdit) Map[K comparable, V any](p *kvo.MapPropRef[K, V]) *kvo.MapEditor[K, V]
- func (e *RecordEdit) New(p *kvo.PropRef[kvo.Record]) *kvo.Editor
- func (e *RecordEdit) Record() kvo.Record
- func (e *RecordEdit) Set[T any, P kvo.Property[T]](p P, value T)
- func (e *RecordEdit) Table() *TableDef
- func (e *RecordEdit) TrySet[T any, P kvo.Property[T]](p P, value T) error
- type RecordScan
- func (s RecordScan[Key]) Chunk(limit int) *RecordChunk[Key]
- func (s RecordScan[Key]) Entries() iter.Seq2[Key, kvo.Record]
- func (s RecordScan) KeyCursor() *KeyCursor[Key]
- func (s RecordScan) Keys() iter.Seq[Key]
- func (s RecordScan) Raw() RawCursor
- func (s RecordScan[Key]) Records() iter.Seq[kvo.Record]
- func (s RecordScan[Key]) Resume(b ScanBookmark) RecordScan[Key]
- func (s RecordScan[Key]) Reversed() RecordScan[Key]
- type RecordStorage
- type ReplicationApplyOptions
- type ReplicationCaptureOptions
- type ReplicationChange
- type ReplicationGroup
- type ReplicationObject
- type ReplicationObjectKind
- type ReplicationOp
- type ReplicationOptions
- type ReplicationPoisoner
- type ReplicationReservation
- type ReplicationSink
- type ReplicationValue
- type RowChunk
- func (c RowChunk) Bookmark() ScanBookmark
- func (c RowChunk) Count() int
- func (c RowChunk) DBTx() *Tx
- func (c *RowChunk[Row, Key]) Entries() iter.Seq2[Key, *Row]
- func (c *RowChunk[Row, Key]) Keys() iter.Seq[Key]
- func (c RowChunk) More() bool
- func (c *RowChunk[Row, Key]) Rows() iter.Seq[*Row]
- func (c RowChunk) Tx() *Tx
- type RowMigrationPolicy
- type RowScan
- func (s RowScan[Row, Key]) Chunk(limit int) *RowChunk[Row, Key]
- func (s RowScan[Row, Key]) Entries() iter.Seq2[Key, *Row]
- func (s RowScan) KeyCursor() *KeyCursor[Key]
- func (s RowScan) Keys() iter.Seq[Key]
- func (s RowScan) Raw() RawCursor
- func (s RowScan[Row, Key]) Resume(b ScanBookmark) RowScan[Row, Key]
- func (s RowScan[Row, Key]) Reversed() RowScan[Row, Key]
- func (s RowScan[Row, Key]) Rows() iter.Seq[*Row]
- type RowTable
- func (t RowTable[Row, Key]) After(txh Txish, key Key) RowScan[Row, Key]
- func (t RowTable[Row, Key]) Before(txh Txish, key Key) RowScan[Row, Key]
- func (t RowTable) Delete(txh Txish, key Key) bool
- func (t RowTable[Row, Key]) Exact(txh Txish, key Key) RowScan[Row, Key]
- func (t RowTable[Row, Key]) ExactIndexScan[IndexKey any](txh Txish, idx *Index[IndexKey], key IndexKey) RowScan[Row, Key]
- func (t RowTable) Exists(txh Txish, key Key) bool
- func (t RowTable[Row, Key]) From(txh Txish, key Key) RowScan[Row, Key]
- func (t RowTable[Row, Key]) Get(txh Txish, key Key) *Row
- func (t RowTable[Row, Key]) GetRaw(txh Txish, key []byte) *Row
- func (t RowTable[Row, Key]) IndexScan[IndexKey any](txh Txish, idx *Index[IndexKey]) RowScan[Row, Key]
- func (t RowTable[Row, Key]) IndexScanAfter[IndexKey any](txh Txish, idx *Index[IndexKey], key IndexKey) RowScan[Row, Key]
- func (t RowTable[Row, Key]) IndexScanBefore[IndexKey any](txh Txish, idx *Index[IndexKey], key IndexKey) RowScan[Row, Key]
- func (t RowTable[Row, Key]) IndexScanFrom[IndexKey any](txh Txish, idx *Index[IndexKey], key IndexKey) RowScan[Row, Key]
- func (t RowTable[Row, Key]) IndexScanThrough[IndexKey any](txh Txish, idx *Index[IndexKey], key IndexKey) RowScan[Row, Key]
- func (t RowTable[Row, Key]) Lookup[IndexKey any](txh Txish, idx *Index[IndexKey], key IndexKey) (Key, *Row)
- func (t RowTable[Row, Key]) LookupKey[IndexKey any](txh Txish, idx *Index[IndexKey], key IndexKey) (Key, bool)
- func (t RowTable) Model() *kvo.Model
- func (t RowTable[Row, Key]) Prefix(txh Txish, key Key, components int) RowScan[Row, Key]
- func (t RowTable[Row, Key]) PrefixIndexScan[IndexKey any](txh Txish, idx *Index[IndexKey], key IndexKey, components int) RowScan[Row, Key]
- func (t RowTable[Row, Key]) Put(txh Txish, row *Row) bool
- func (t RowTable[Row, Key]) PutByKey(txh Txish, key Key, row *Row) bool
- func (t RowTable[Row, Key]) Range(txh Txish, lower, upper Key) RowScan[Row, Key]
- func (t RowTable[Row, Key]) RangeIndexScan[IndexKey any](txh Txish, idx *Index[IndexKey], lower, upper IndexKey) RowScan[Row, Key]
- func (t RowTable[Row, Key]) Records() Table[Key]
- func (t RowTable[Row, Key]) Scan(txh Txish) RowScan[Row, Key]
- func (t RowTable) Table() *TableDef
- func (t RowTable[Row, Key]) Through(txh Txish, key Key) RowScan[Row, Key]
- func (t RowTable[Row, Key]) TryGet(txh Txish, key Key) (*Row, ValueMeta, error)
- func (t RowTable[Row, Key]) TryGetRaw(txh Txish, key []byte) (*Row, ValueMeta, error)
- func (t RowTable[Row, Key]) TryLookup[IndexKey any](txh Txish, idx *Index[IndexKey], key IndexKey) (Key, *Row, ValueMeta, error)
- type SKey
- type ScanBookmark
- type ScanMethod
- type ScanOptions
- func ExactIDRangeScan(exact, lower, upper any, lowerInc, upperInc bool) ScanOptions
- func ExactIDRangeScanVal(exact, lower, upper reflect.Value, lowerInc, upperInc bool) ScanOptions
- func ExactScan(v any) ScanOptions
- func ExactScanVal(val reflect.Value) ScanOptions
- func FullScan() ScanOptions
- func LowerBoundScan(lower any, includeEqual bool) ScanOptions
- func RangeScan(lower, upper any, lowerInc, upperInc bool) ScanOptions
- func RangeScanVal(lower, upper reflect.Value, lowerInc, upperInc bool) ScanOptions
- func UpperBoundScan(upper any, includeEqual bool) ScanOptions
- func (so ScanOptions) LogString() string
- func (so ScanOptions) Prefix(els int) ScanOptions
- func (so ScanOptions) PrimaryKeyRange(lower, upper any, lowerInc, upperInc bool) ScanOptions
- func (so ScanOptions) PrimaryKeyRangeVal(lower, upper reflect.Value, lowerInc, upperInc bool) ScanOptions
- func (so ScanOptions) Resume(b ScanBookmark) ScanOptions
- func (so ScanOptions) Reversed() ScanOptions
- type Schema
- func (scm *Schema) Include(peer *Schema)
- func (scm *Schema) KVMapByNameHash(hash uint64) *KVMap
- func (scm *Schema) KVTableByNameHash(hash uint64) *KVTable
- func (scm *Schema) KVTableNamed(name string) *KVTable
- func (scm *Schema) KVTables() []*KVTable
- func (scm *Schema) NameHash(name string) uint64
- func (scm *Schema) TableByNameHash(hash uint64) *TableDef
- func (scm *Schema) TableByRow(row any) *TableDef
- func (scm *Schema) TableByRowType(rt reflect.Type) *TableDef
- func (scm *Schema) TableNamed(name string) *TableDef
- func (scm *Schema) Tables() []*TableDef
- type StorageFormat
- type Table
- func (t Table[Key]) After(txh Txish, key Key) RecordScan[Key]
- func (t Table[Key]) Before(txh Txish, key Key) RecordScan[Key]
- func (t Table) Delete(txh Txish, key Key) bool
- func (t Table[Key]) Edit(txh Txish, key Key) *RecordEdit
- func (t Table[Key]) EditOrCreate(txh Txish, key Key) *RecordEdit
- func (t Table[Key]) Exact(txh Txish, key Key) RecordScan[Key]
- func (t Table[Key]) ExactIndexScan[IndexKey any](txh Txish, idx *Index[IndexKey], key IndexKey) RecordScan[Key]
- func (t Table) Exists(txh Txish, key Key) bool
- func (t Table[Key]) From(txh Txish, key Key) RecordScan[Key]
- func (t Table[Key]) Get(txh Txish, key Key) kvo.Record
- func (t Table[Key]) GetRaw(txh Txish, key []byte) kvo.Record
- func (t Table[Key]) IndexScan[IndexKey any](txh Txish, idx *Index[IndexKey]) RecordScan[Key]
- func (t Table[Key]) IndexScanAfter[IndexKey any](txh Txish, idx *Index[IndexKey], key IndexKey) RecordScan[Key]
- func (t Table[Key]) IndexScanBefore[IndexKey any](txh Txish, idx *Index[IndexKey], key IndexKey) RecordScan[Key]
- func (t Table[Key]) IndexScanFrom[IndexKey any](txh Txish, idx *Index[IndexKey], key IndexKey) RecordScan[Key]
- func (t Table[Key]) IndexScanThrough[IndexKey any](txh Txish, idx *Index[IndexKey], key IndexKey) RecordScan[Key]
- func (t Table[Key]) Key(edit *RecordEdit) Key
- func (t Table[Key]) Lookup[IndexKey any](txh Txish, idx *Index[IndexKey], key IndexKey) (Key, kvo.Record)
- func (t Table[Key]) LookupKey[IndexKey any](txh Txish, idx *Index[IndexKey], key IndexKey) (Key, bool)
- func (t Table) Model() *kvo.Model
- func (t Table[Key]) New(txh Txish, key Key) *RecordEdit
- func (t Table[Key]) Prefix(txh Txish, key Key, components int) RecordScan[Key]
- func (t Table[Key]) PrefixIndexScan[IndexKey any](txh Txish, idx *Index[IndexKey], key IndexKey, components int) RecordScan[Key]
- func (t Table[Key]) Put(txh Txish, key Key, r kvo.Record) bool
- func (t Table[Key]) PutChecked(txh Txish, key Key, r kvo.Record, expected ValueMeta) bool
- func (t Table[Key]) Range(txh Txish, lower, upper Key) RecordScan[Key]
- func (t Table[Key]) RangeIndexScan[IndexKey any](txh Txish, idx *Index[IndexKey], lower, upper IndexKey) RecordScan[Key]
- func (t Table[Key]) Rows[Row any]() RowTable[Row, Key]
- func (t Table[Key]) Save(txh Txish, edit *RecordEdit) bool
- func (t Table[Key]) Scan(txh Txish) RecordScan[Key]
- func (t Table) Table() *TableDef
- func (t Table[Key]) Through(txh Txish, key Key) RecordScan[Key]
- func (t Table[Key]) TryEdit(txh Txish, key Key) (*RecordEdit, error)
- func (t Table[Key]) TryEditOrCreate(txh Txish, key Key) (*RecordEdit, error)
- func (t Table[Key]) TryGet(txh Txish, key Key) (kvo.Record, ValueMeta, error)
- func (t Table[Key]) TryGetRaw(txh Txish, key []byte) (kvo.Record, ValueMeta, error)
- func (t Table[Key]) TryLookup[IndexKey any](txh Txish, idx *Index[IndexKey], key IndexKey) (Key, kvo.Record, ValueMeta, error)
- func (t Table[Key]) TryNew(txh Txish, key Key) (*RecordEdit, error)
- func (t Table[Key]) TryPutChecked(txh Txish, key Key, r kvo.Record, expected ValueMeta) (ValueMeta, error)
- func (t Table[Key]) TrySave(txh Txish, edit *RecordEdit) (ValueMeta, error)
- type TableBuilder
- func (b *TableBuilder[Key]) AddIndex[T any](name string, ...) *Index[T]
- func (b *TableBuilder[Key]) AddMigrator(toVer uint64, f func(tx *Tx, key Key, edit *kvo.Editor))
- func (b *TableBuilder[Key]) SetIndexer(f func(Key, kvo.Record, *IndexBuilder))
- func (b *TableBuilder[Key]) SetNativeSchema(schema kvo.NativeSchema)
- func (b *TableBuilder[Key]) SetRecordStorage(storage RecordStorage)
- func (b *TableBuilder[Key]) SetSchemaVersion(ver uint64)
- func (b *TableBuilder[Key]) SuppressContentWhenLogging()
- func (b *TableBuilder[Key]) Tag(tag *Tag)
- type TableDef
- func (tbl *TableDef) DecodeKeyVal(rawKey []byte) reflect.Value
- func (tbl *TableDef) DecodeKeyValInto(keyVal reflect.Value, rawKey []byte)
- func (tbl *TableDef) EncodeKey(key any) []byte
- func (tbl *TableDef) EncodeKeyVal(keyVal reflect.Value) []byte
- func (tbl *TableDef) IndexNamed(name string) *IndexDef
- func (tbl *TableDef) Indices() []*IndexDef
- func (tbl *TableDef) KeyString(key any) string
- func (tbl *TableDef) KeyType() reflect.Type
- func (t *TableDef) Model() *kvo.Model
- func (tbl *TableDef) Name() string
- func (tbl *TableDef) NameHash() uint64
- func (tbl *TableDef) NewRow() any
- func (tbl *TableDef) NewRowVal() reflect.Value
- func (tbl *TableDef) ParseKey(s string) (any, error)
- func (tbl *TableDef) ParseKeyVal(s string) (reflect.Value, error)
- func (tbl *TableDef) RawKeyString(keyRaw []byte) string
- func (tbl *TableDef) RowHasZeroKey(row any) bool
- func (tbl *TableDef) RowKey(row any) any
- func (tbl *TableDef) RowKeyVal(rowVal reflect.Value) reflect.Value
- func (tbl *TableDef) RowType() reflect.Type
- func (tbl *TableDef) RowValHasZeroKey(rowVal reflect.Value) bool
- func (t *TableDef) Rows[Row, Key any]() RowTable[Row, Key]
- func (tbl *TableDef) SchemaVersion() uint64
- func (tbl *TableDef) SetRowKey(row, key any)
- func (tbl *TableDef) SetRowKeyVal(rowVal, keyVal reflect.Value)
- func (t *TableDef) TableDef() *TableDef
- func (tbl *TableDef) TryDecodeKeyValInto(keyVal reflect.Value, rawKey []byte) error
- func (tbl *TableDef) TryRawKeyString(keyRaw []byte) (string, error)
- func (t *TableDef) Typed[Key any]() Table[Key]
- type TableError
- type TableStats
- type Tablish
- type Tag
- type TagFamily
- type TagFamilyCardinality
- type TaggableImpl
- type Tx
- func (tx *Tx) BeginVerbose()
- func (tx *Tx) BoltTx() *bbolt.Tx
- func (tx *Tx) Close()
- func (tx *Tx) Commit() error
- func (tx *Tx) CommitDespiteError()
- func (tx *Tx) DB() *DB
- func (tx *Tx) DBTx() *Tx
- func (tx *Tx) DecodeMementoVal(tblArg AnyTable, keyRaw []byte, memento []byte) (rowVal reflect.Value, meta ValueMeta, err error)
- func (tx *Tx) DeleteByKey(tblArg AnyTable, key any) bool
- func (tx *Tx) DeleteByKeyRaw(tblArg AnyTable, keyRaw []byte) bool
- func (tx *Tx) DeleteByKeyVal(tblArg AnyTable, keyVal reflect.Value) bool
- func (tx *Tx) DeleteRecord(tblArg AnyTable, row kvo.Record) bool
- func (tx *Tx) Dump(f DumpFlags) string
- func (tx *Tx) EditRecord(tArg AnyTable, key any, edit func(*kvo.Editor))
- func (tx *Tx) EndVerbose()
- func (tx *Tx) Exists(tblArg AnyTable, key any) bool
- func (tx *Tx) ExistsByKeyRaw(tblArg AnyTable, keyRaw []byte) bool
- func (tx *Tx) Get(tblArg AnyTable, key any) (any, ValueMeta)
- func (tx *Tx) GetByKeyRaw(tblArg AnyTable, keyRaw []byte) (any, ValueMeta)
- func (tx *Tx) GetByKeyVal(tblArg AnyTable, keyVal reflect.Value) (any, ValueMeta)
- func (tx *Tx) GetMemo(key string) (any, bool)
- func (tx *Tx) GetMeta(tblArg AnyTable, key any) ValueMeta
- func (tx *Tx) GetMetaByKeyVal(tblArg AnyTable, keyVal reflect.Value) ValueMeta
- func (tx *Tx) GetRecord(tArg AnyTable, key any) kvo.Record
- func (tx *Tx) GetRecordByKeyRaw(t AnyTable, key []byte) kvo.Record
- func (tx *Tx) GetRecordByKeyVal(tArg AnyTable, key reflect.Value) kvo.Record
- func (tx *Tx) IndexScan(idxArg AnyIndex, opt ScanOptions) *RawIndexCursor
- func (tx *Tx) IsWritable() bool
- func (tx *Tx) KVGet(tbl *KVTable, key []byte) fast1.ImmutableMap
- func (tx *Tx) KVGetRaw(tbl *KVTable, key []byte) []byte
- func (tx *Tx) KVIndexScan(idx *KVIndex, rang RawRange) *KVCursor
- func (tx *Tx) KVPut(tbl *KVTable, key []byte, value fast1.Packable)
- func (tx *Tx) KVPutRaw(tbl *KVTable, key, value []byte)
- func (tx *Tx) KVTableScan(tbl *KVTable, rang RawRange) *KVCursor
- func (tx *Tx) KVTableStats(tbl *KVTable) TableStats
- func (tx *Tx) Lookup(idxArg AnyIndex, indexKey any) any
- func (tx *Tx) LookupExists(idxArg AnyIndex, indexKeyVal reflect.Value) bool
- func (tx *Tx) LookupKey(idxArg AnyIndex, indexKey any) any
- func (tx *Tx) LookupKeyVal(idxArg AnyIndex, indexKeyVal reflect.Value) reflect.Value
- func (tx *Tx) LookupVal(idxArg AnyIndex, indexKeyVal reflect.Value) (reflect.Value, ValueMeta)
- func (tx *Tx) Memo(key string, f func() (any, error)) (any, error)
- func (tx *Tx) Metadata() TxMetadata
- func (tx *Tx) NewRecordEdit(tArg AnyTable, key any) *RecordEdit
- func (tx *Tx) OnChange(opts map[*TableDef]ChangeFlags, f func(tx *Tx, chg *Change))
- func (tx *Tx) OpenRecordEdit(tArg AnyTable, key any) *RecordEdit
- func (tx *Tx) Put(tblArg AnyTable, row any) (oldMeta, newMeta ValueMeta)
- func (tx *Tx) PutByKey(tblArg AnyTable, key, row any) (oldMeta, newMeta ValueMeta)
- func (tx *Tx) PutRecordChecked(tArg AnyTable, key any, row kvo.Record, expected ValueMeta)
- func (tx *Tx) PutVal(tblArg AnyTable, rowVal reflect.Value) (oldMeta, newMeta ValueMeta)
- func (tx *Tx) Reindex(tblArg AnyTable, idxArg AnyIndex)
- func (tx *Tx) SaveRecord(e *RecordEdit)
- func (tx *Tx) Schema() *Schema
- func (tx *Tx) SetLogger(logger *slog.Logger)
- func (tx *Tx) StartTime() time.Time
- func (tx *Tx) TableScan(tblArg AnyTable, opt ScanOptions) *RawTableCursor
- func (tx *Tx) TableStats(tblArg AnyTable) TableStats
- func (tx *Tx) TryEditRecord(tArg AnyTable, key any, edit func(*kvo.Editor) error) (ValueMeta, error)
- func (tx *Tx) TryGet(tblArg AnyTable, key any) (any, ValueMeta, error)
- func (tx *Tx) TryGetByKeyVal(tblArg AnyTable, keyVal reflect.Value) (any, ValueMeta, error)
- func (tx *Tx) TryGetRecord(tArg AnyTable, key any) (kvo.Record, ValueMeta, error)
- func (tx *Tx) TryGetRecordByKeyRaw(t AnyTable, key []byte) (kvo.Record, ValueMeta, error)
- func (tx *Tx) TryGetRecordByKeyVal(tArg AnyTable, key reflect.Value) (kvo.Record, ValueMeta, error)
- func (tx *Tx) TryNewRecordEdit(tArg AnyTable, key any) (*RecordEdit, error)
- func (tx *Tx) TryOpenRecordEdit(tArg AnyTable, key any) (*RecordEdit, error)
- func (tx *Tx) TryPutRecordChecked(tArg AnyTable, key any, row kvo.Record, expected ValueMeta) (ValueMeta, error)
- func (tx *Tx) TrySaveRecord(e *RecordEdit) (ValueMeta, error)
- func (tx *Tx) TryUpgradeRecord(tArg AnyTable, key any) (bool, error)
- func (tx *Tx) UnsafeDeleteByKeyRawSkippingIndex(tblArg AnyTable, keyRaw []byte) bool
- func (tx *Tx) UpgradeRecord(tArg AnyTable, key any) bool
- type TxMetadata
- type TxObservation
- type Txish
- type ValueMeta
Constants ¶
const ( DumpTableHeaders = DumpFlags(1 << iota) DumpRows DumpStats DumpIndices DumpIndexRows DumpAll = DumpFlags(0xFFFFFFFFFFFFFFFF) )
const ( MsgPack encodingMethod = iota JSON )
const ( ScanMethodFull = ScanMethod(iota) ScanMethodExact ScanMethodRange )
const InMemory = "memory:"
Variables ¶
var ( ErrReplicationOverload = errors.New("edb: replication RAM capacity exhausted") ErrReplicationGroupSize = errors.New("edb: replication group exceeds limit") ErrReplicationSchema = errors.New("edb: unsupported replication schema revision") ErrReplicationShardChange = errors.New("edb: shard change requires explicit delete and put") ErrReplicationTransactionID = errors.New("edb: replication transaction ID must advance") ErrReplicationPoisoned = errors.New("edb: replication capture is poisoned") )
var ( ReaderCount atomic.Int64 WriterCount atomic.Int64 )
var Break = errors.New("break")
var ErrBucketNotFound = errors.New("bucket not found")
ErrBucketNotFound is returned by StorageTx.DeleteBucket when the bucket doesn't exist.
var ErrLocalWriteRejected = errors.New("edb: local application writes are fenced")
var ErrNoRecordBinding = errors.New("table has no record binding")
var ErrRecordSchemaVersion = errors.New("row needs a schema migration before record access")
Functions ¶
func AllLimited ¶ added in v0.1.6
func AllRawKeys ¶
func AllTableRows ¶
func AllUntypedKeys ¶
func GetByKeyRaw ¶ added in v0.1.6
func IndexPrimaryKey ¶ added in v0.4.13
IndexPrimaryKey decodes a callback's primary-key cell using the table's exact Go key type. Scalars also support AsUint, AsString, etc. Aggregate keys use native Go storage, not VM cell arrays. Returned strings and slices are borrowed; neither they nor the original cell may be retained or mutated by the callback.
func LookupExists ¶ added in v0.2.0
func PutByKey ¶ added in v0.4.13
PutByKey is the explicitly keyed counterpart of Put for native Go rows.
func ReadChunks ¶ added in v0.4.13
func ReadChunks[S chunkScan[C], C scanChunk](db *DB, metadata TxMetadata, limit int, query func(*Tx) S) iter.Seq[C]
ReadChunks yields nonempty chunks, opening and closing a read transaction for each one. query must return the same query using the supplied transaction on each call; an initial Resume bookmark is honored. Both RecordScan and RowScan are supported, with their corresponding chunk type inferred automatically.
Use the yielded chunk as Txish for joins. Breaking the outer loop, returning, or panicking closes its transaction. Breaking an inner iteration ends that chunk early and the next starts after the last consumed entry. Leaving a chunk entirely unconsumed stops the scan rather than looping forever.
The loop body holds a read transaction; perform writes outside it. Use Chunk with explicit transaction boundaries for read-then-write batches.
Each chunk sees a NEW snapshot. This is not a consistent whole-database export: writes between chunks can add, remove, or move entries. Retain records with Own before leaving a chunk. Never mutate the scanned index while walking its cursor; collect keys first, close the reader, then write.
func ReadReplicationStatus ¶ added in v0.4.17
Types ¶
type AnyIndex ¶ added in v0.4.13
type AnyIndex interface{ IndexDef() *IndexDef }
AnyIndex accepts a typed index or its shared definition.
type AnyTable ¶ added in v0.4.13
type AnyTable interface {
TableDef() *TableDef
}
AnyTable accepts a typed table or its shared definition. Database operations resolve the definition once; cursors and caches retain the concrete pointer.
type Change ¶ added in v0.2.0
type Change struct {
// contains filtered or unexported fields
}
func (*Change) HasNewGoStruct ¶ added in v0.4.13
func (*Change) HasNewRecord ¶ added in v0.4.13
func (*Change) HasOldGoStruct ¶ added in v0.4.13
func (*Change) HasOldRecord ¶ added in v0.4.13
func (*Change) NewGoStruct ¶ added in v0.4.13
NewGoStruct returns an independently decoded *T, or nil when absent or not requested. It contains all persisted fields, including fields outside a KVO projection, and the database primary key. Mutating it does not save changes.
func (*Change) NewGoStructVal ¶ added in v0.4.13
func (*Change) NewRecord ¶ added in v0.4.13
NewRecord returns the requested post-write record; it is missing for deletes. Records borrow transaction data. Call Own to retain one beyond the transaction.
func (*Change) OldGoStruct ¶ added in v0.4.13
OldGoStruct returns an independently decoded pre-write *T, or nil when absent, not requested, or unreadable. Old-value decode errors are logged when possible and do not prevent repairing or deleting a damaged value.
func (*Change) OldGoStructVal ¶ added in v0.4.13
type ChangeFlags ¶ added in v0.2.0
type ChangeFlags uint64
const ( ChangeFlagNotify ChangeFlags = 1 << iota ChangeFlagIncludeKey ChangeFlagIncludeNewRecord ChangeFlagIncludeOldRecord ChangeFlagIncludeNewGoStruct ChangeFlagIncludeOldGoStruct )
func (ChangeFlags) Contains ¶ added in v0.2.0
func (v ChangeFlags) Contains(f ChangeFlags) bool
func (ChangeFlags) ContainsAny ¶ added in v0.2.0
func (v ChangeFlags) ContainsAny(f ChangeFlags) bool
type Cursor ¶
func ExactIndexScan ¶
func ExactTableScan ¶ added in v0.1.6
func FullReverseTableScan ¶ added in v0.1.4
func FullTableScan ¶ added in v0.1.1
func PrefixIndexScan ¶
func RangeIndexScan ¶ added in v0.1.6
func RangeTableScan ¶ added in v0.1.6
func ReverseExactIndexScan ¶ added in v0.1.5
func ReversePrefixIndexScan ¶ added in v0.1.5
func ReverseRangeIndexScan ¶ added in v0.1.6
func ReverseRangeTableScan ¶ added in v0.1.6
func (Cursor[Row]) Record ¶ added in v0.4.13
Record panics on error. Use TryRecord to handle errors explicitly.
func (Cursor[Row]) RecordEdit ¶ added in v0.4.13
func (c Cursor[Row]) RecordEdit() *RecordEdit
RecordEdit panics on error. Use TryRecordEdit to handle errors explicitly.
func (Cursor[Row]) RowInto ¶ added in v0.4.13
RowInto replaces *dst with the current row. A scan can reuse the same struct on each iteration. Use Row when handing independently owned rows to another consumer. Maps and slices from earlier rows are never reused.
func (Cursor[Row]) TryRecordEdit ¶ added in v0.4.13
func (c Cursor[Row]) TryRecordEdit() (*RecordEdit, error)
TryRecordEdit opens the current cursor row for writing without full decoding when its codec supports direct access. It retains the stale-save check. Call it after a successful Next, while the cursor is positioned on the row.
type DB ¶
type DB struct {
ReaderCount atomic.Int64
WriterCount atomic.Int64
PendingWriterCount atomic.Int64
ReadCount atomic.Uint64
WriteCount atomic.Uint64
// contains filtered or unexported fields
}
func (*DB) AllowsLocalWrites ¶ added in v0.4.17
func (*DB) AllowsRowMigrations ¶ added in v0.4.17
AllowsRowMigrations exposes the policy for application migration schedulers. The application remains responsible for gating its jobs and external effects.
func (*DB) ApplyReplication ¶ added in v0.4.17
func (db *DB) ApplyReplication(g *ReplicationGroup) error
ApplyReplication consumes one complete replication log-validated source group. The consumer validates history/filter continuity and delivers groups in order. Caller-owned bytes must remain valid until return; failed groups can be retried.
func (*DB) BeginRead ¶
func (db *DB) BeginRead(metadata TxMetadata) (tx *Tx)
func (*DB) BeginUpdate ¶
func (db *DB) BeginUpdate(metadata TxMetadata) (tx *Tx)
func (*DB) Close ¶
func (db *DB) Close()
Close is safe to call multiple times, but not concurrently.
func (*DB) CloseWithSafeToQuitCallback ¶ added in v0.3.23
func (db *DB) CloseWithSafeToQuitCallback(safeToQuit func())
Close is safe to call multiple times, but not concurrently.
func (*DB) DescribeOpenTxns ¶ added in v0.1.6
func (*DB) Read ¶
func (db *DB) Read(metadata TxMetadata, f func(tx *Tx))
func (*DB) ReplicationPoisoned ¶ added in v0.4.17
func (*DB) ReplicationStatus ¶ added in v0.4.17
ReplicationStatus returns the database's last committed replication transaction ID from a snapshot. Capture allocates the next ID; apply preserves the incoming ID. Both update this checkpoint atomically with their data. Uncommitted/aborted attempts are invisible. Missing status is zero, even with replication disabled. This is neither a Bolt ID nor an external replication log cursor. The consumer validates history identity, detects gaps and chooses recovery policy.
func (*DB) Tx ¶
Tx currently implements Check-Mutate phases for writable transactions:
Phase 1, Check: before any modifications are made. Runs inside bdb.Batch. Returning an error won't cause the entire batch to fail.
Phase 2, Mutate: from the first mutation. Runs inside bdb.Batch. The entire transaction will be retried in case of error.
TODO: split Mutate phase into Mutate and Post-Mutate phases:
Phase 1, Check (initial phase): inside bdb.Batch, error does not fail batch.
Phase 2, Mutate (initiated by any mutation call): inside bdb.Batch, error fails batch.
Phase 3, Read (initiated by explicit call like Commit): mutations committed, outside bdb.Batch, a new read-only tx is opened on demand.
Check-Mutate-Read would allow to avoid holding the batch during rendering.
A read-only transaction would be a natural extension of Check-Mutate-Read with Check and Mutate phases skipped.
func (*DB) Write ¶
func (db *DB) Write(metadata TxMetadata, f func(tx *Tx))
type FlatMarshaler ¶
type FlatMarshallable ¶
type FlatMarshallable interface {
FlatMarshaler
FlatUnmarshaler
}
type FlatUnmarshaler ¶
type Index ¶
type Index[IndexKey any] struct { // contains filtered or unexported fields }
Index declares the index-key type. Table methods supply the primary-key type when looking up records or scanning index entries.
type IndexBuilder ¶
type IndexBuilder struct {
// contains filtered or unexported fields
}
func (*IndexBuilder) PrimaryKey ¶ added in v0.4.13
func (b *IndexBuilder) PrimaryKey() any
PrimaryKey decodes the row key for index expressions that need it. Add already associates each entry with its row.
type IndexDef ¶ added in v0.4.13
type IndexDef struct {
// contains filtered or unexported fields
}
func (*IndexDef) DecodeIndexKeyVal ¶ added in v0.4.13
func (*IndexDef) DecodeIndexKeyValInto ¶ added in v0.4.13
func (*IndexDef) DecodeKeyVal ¶ added in v0.4.13
func (*IndexDef) DecodeKeyValInto ¶ added in v0.4.13
func (*IndexDef) EncodeKeyVal ¶ added in v0.4.13
func (*IndexDef) ParseNakedIndexKey ¶ added in v0.4.13
func (*IndexDef) ParseNakedIndexKeyVal ¶ added in v0.4.13
func (*IndexDef) RawKeyString ¶ added in v0.4.13
type IndexInitialFillMode ¶ added in v0.4.4
type IndexInitialFillMode int
const ( IndexInitialFillModeSkip IndexInitialFillMode = iota IndexInitialFillModeBlocking )
type KVCursor ¶ added in v0.3.1
type KVCursor struct {
// contains filtered or unexported fields
}
func (*KVCursor) Object ¶ added in v0.3.1
func (c *KVCursor) Object() fast1.ImmutableMap
func (*KVCursor) Objects ¶ added in v0.3.1
func (c *KVCursor) Objects() func(yield func(k []byte, o fast1.ImmutableMap) bool)
func (*KVCursor) RawIndexKey ¶ added in v0.3.2
type KVIndexContentBuilder ¶ added in v0.3.2
type KVIndexContentBuilder struct {
// contains filtered or unexported fields
}
func (*KVIndexContentBuilder) Add ¶ added in v0.3.2
func (b *KVIndexContentBuilder) Add(ik []byte)
type KVIndexKey ¶ added in v0.3.2
type KVIndexKey interface {
Clone() KVIndexKey
PutBytes(raw []byte) bool
String() string
FillPrimaryKey(pk KVKey)
}
type KVIndexKeyToPrimaryKey ¶ added in v0.3.2
type KVIndexer ¶ added in v0.3.2
type KVIndexer = func(b *KVIndexContentBuilder, pk []byte, v fast1.ImmutableRecord)
type KVTable ¶ added in v0.3.0
type KVTable struct {
TaggableImpl
// contains filtered or unexported fields
}
func DefineKVTable ¶ added in v0.3.0
func DefineRawTable ¶ added in v0.3.3
func DefineRawTable(scm *Schema, name string, build func(b *KVTableBuilder)) *KVTable
func (*KVTable) KeyBytesToString ¶ added in v0.3.2
type KVTableBuilder ¶ added in v0.3.0
type KVTableBuilder struct {
// contains filtered or unexported fields
}
func (*KVTableBuilder) DefineIndex ¶ added in v0.3.2
func (b *KVTableBuilder) DefineIndex(name string, keySample KVIndexKey, resolver KVIndexKeyToPrimaryKey, indexer KVIndexer) *KVIndex
func (*KVTableBuilder) Tag ¶ added in v0.3.8
func (b *KVTableBuilder) Tag(tag *Tag)
type KeyCursor ¶ added in v0.4.13
type KeyCursor[Key any] struct { // contains filtered or unexported fields }
KeyCursor is a single-pass primary-key stream. It never fetches row payloads. Keys decodes owned Go keys; RawKey borrows the current transaction's storage. A cursor and any union/intersection built from it stay in that transaction.
func (*KeyCursor[Key]) Intersect ¶ added in v0.4.13
Intersect consumes its inputs with the same rules as Union, emitting only keys present in every input. It does not read or decode any rows.
func (*KeyCursor[Key]) Union ¶ added in v0.4.13
Union consumes c and the other cursors, returning each primary key once. Inputs must scan the same table, transaction, and direction and be ordered by primary key. Do not reuse an input cursor after composing it. Encoded keys are compared directly, including strings and composite keys; only emitted keys are decoded. Setup costs O(inputs) space, with no per-key allocations from merging. Native key decoding may allocate for strings/custom key types.
Exact index scans with non-unsigned keys receive a key-only preflight pass: tuple-footer bytes embedded in variable-length keys can violate primary-key order. An inversion panics before any results are emitted; use materialized sets for such key domains. Built-in unsigned keys need no extra pass.
type LocalWriteMode ¶ added in v0.4.17
type LocalWriteMode uint8
const ( AllowLocalWrites LocalWriteMode = iota RejectLocalWrites )
func (LocalWriteMode) String ¶ added in v0.4.17
func (p LocalWriteMode) String() string
type LocalWritePolicy ¶ added in v0.4.17
type LocalWritePolicy struct {
Mode LocalWriteMode
Include func(ReplicationObject) bool
}
LocalWritePolicy controls application mutations, not DDL, apply or index maintenance.
type Options ¶
type Options struct {
// Policies are independent of replication capabilities; zero values preserve existing behavior.
LocalWrites LocalWritePolicy
RowMigrations RowMigrationPolicy
Replication *ReplicationOptions
Logf func(format string, args ...any)
Verbose bool
IsTesting bool
MmapSize int
NoPersistentFreeList bool
CaptureTxStack bool
ReuseTxBuffers bool
ObserveWriteTransaction func(TxObservation)
ObserveReadTransaction func(TxObservation)
}
type RawCursor ¶
type RawCursor interface {
Bookmark() ScanBookmark
Table() *TableDef
Tx() *Tx
Next() bool
Key() any
// UintKey returns the primary key as uint64. It accepts unsigned integer
// types, including named types, and panics for other key types. The built-in
// unsigned encoding is read without reflection or allocation.
UintKey() uint64
RawKey() []byte
RowVal() (reflect.Value, ValueMeta)
TryRowVal() (reflect.Value, ValueMeta, error)
Meta() ValueMeta
Row() (any, ValueMeta)
TryRow() (any, ValueMeta, error)
RawRow() []byte
ValueMemento() []byte
}
type RawIndexCursor ¶
type RawIndexCursor struct {
// contains filtered or unexported fields
}
func (*RawIndexCursor) Bookmark ¶ added in v0.4.13
func (c *RawIndexCursor) Bookmark() ScanBookmark
Bookmark owns the complete index position. For nonunique indexes the primary key is part of the encoded position; unique indexes sort by index key alone.
func (*RawIndexCursor) IndexKey ¶ added in v0.1.6
func (c *RawIndexCursor) IndexKey() any
func (*RawIndexCursor) Key ¶
func (c *RawIndexCursor) Key() any
func (*RawIndexCursor) Meta ¶
func (c *RawIndexCursor) Meta() ValueMeta
func (*RawIndexCursor) Next ¶
func (c *RawIndexCursor) Next() bool
func (*RawIndexCursor) RawKey ¶
func (c *RawIndexCursor) RawKey() []byte
func (*RawIndexCursor) RawRow ¶ added in v0.2.0
func (c *RawIndexCursor) RawRow() []byte
func (*RawIndexCursor) Record ¶ added in v0.4.13
func (c *RawIndexCursor) Record() kvo.Record
Record panics on error. Use TryRecord to handle errors explicitly.
func (*RawIndexCursor) RecordEdit ¶ added in v0.4.13
func (c *RawIndexCursor) RecordEdit() *RecordEdit
RecordEdit panics on error. Use TryRecordEdit to handle errors explicitly.
func (*RawIndexCursor) Row ¶
func (c *RawIndexCursor) Row() (any, ValueMeta)
func (*RawIndexCursor) Table ¶
func (c *RawIndexCursor) Table() *TableDef
func (*RawIndexCursor) TryRecord ¶ added in v0.4.13
func (c *RawIndexCursor) TryRecord() (kvo.Record, ValueMeta, error)
func (*RawIndexCursor) TryRecordEdit ¶ added in v0.4.13
func (c *RawIndexCursor) TryRecordEdit() (*RecordEdit, error)
func (*RawIndexCursor) TryRow ¶ added in v0.2.1
func (c *RawIndexCursor) TryRow() (any, ValueMeta, error)
func (*RawIndexCursor) TryRowVal ¶ added in v0.2.1
func (c *RawIndexCursor) TryRowVal() (reflect.Value, ValueMeta, error)
func (*RawIndexCursor) Tx ¶
func (c *RawIndexCursor) Tx() *Tx
func (*RawIndexCursor) UintKey ¶ added in v0.4.13
func (c *RawIndexCursor) UintKey() uint64
UintKey returns the current row's unsigned primary key, not the index key.
func (*RawIndexCursor) ValueMemento ¶ added in v0.3.17
func (c *RawIndexCursor) ValueMemento() []byte
type RawRange ¶ added in v0.3.1
type RawRange struct {
Prefix []byte
Lower []byte
Upper []byte
LowerInc bool
UpperInc bool
Reverse bool
}
RawRange defines a range of byte strings. The constructors use mnemonics: O means open, I means inclusive, E means exclusive; the first letter is for the lower bound, the second for the upper bound.
type RawRangeCursor ¶ added in v0.3.1
type RawRangeCursor struct {
// contains filtered or unexported fields
}
func (*RawRangeCursor) Key ¶ added in v0.3.1
func (c *RawRangeCursor) Key() []byte
func (*RawRangeCursor) Next ¶ added in v0.3.1
func (c *RawRangeCursor) Next() bool
func (*RawRangeCursor) Value ¶ added in v0.3.1
func (c *RawRangeCursor) Value() []byte
type RawTableCursor ¶
type RawTableCursor struct {
// contains filtered or unexported fields
}
func (*RawTableCursor) Bookmark ¶ added in v0.4.13
func (c *RawTableCursor) Bookmark() ScanBookmark
Bookmark copies the last visited position, including after exhaustion. Call it before closing the transaction. It does not fetch or decode a row.
func (*RawTableCursor) Key ¶
func (c *RawTableCursor) Key() any
func (*RawTableCursor) Meta ¶
func (c *RawTableCursor) Meta() ValueMeta
func (*RawTableCursor) Next ¶
func (c *RawTableCursor) Next() bool
func (*RawTableCursor) RawKey ¶
func (c *RawTableCursor) RawKey() []byte
func (*RawTableCursor) RawRow ¶ added in v0.2.0
func (c *RawTableCursor) RawRow() []byte
func (*RawTableCursor) Record ¶ added in v0.4.13
func (c *RawTableCursor) Record() kvo.Record
Record panics on error. Use TryRecord to handle errors explicitly.
func (*RawTableCursor) RecordEdit ¶ added in v0.4.13
func (c *RawTableCursor) RecordEdit() *RecordEdit
RecordEdit panics on error. Use TryRecordEdit to handle errors explicitly.
func (*RawTableCursor) Row ¶
func (c *RawTableCursor) Row() (any, ValueMeta)
func (*RawTableCursor) Table ¶
func (c *RawTableCursor) Table() *TableDef
func (*RawTableCursor) TryRecord ¶ added in v0.4.13
func (c *RawTableCursor) TryRecord() (kvo.Record, ValueMeta, error)
func (*RawTableCursor) TryRecordEdit ¶ added in v0.4.13
func (c *RawTableCursor) TryRecordEdit() (*RecordEdit, error)
func (*RawTableCursor) TryRow ¶ added in v0.2.1
func (c *RawTableCursor) TryRow() (any, ValueMeta, error)
func (*RawTableCursor) TryRowVal ¶ added in v0.2.1
func (c *RawTableCursor) TryRowVal() (reflect.Value, ValueMeta, error)
func (*RawTableCursor) Tx ¶
func (c *RawTableCursor) Tx() *Tx
func (*RawTableCursor) UintKey ¶ added in v0.4.13
func (c *RawTableCursor) UintKey() uint64
UintKey returns the current unsigned primary key without boxing it.
func (*RawTableCursor) ValueMemento ¶ added in v0.3.17
func (c *RawTableCursor) ValueMemento() []byte
type RecordChunk ¶ added in v0.4.13
type RecordChunk[Key any] struct { // contains filtered or unexported fields }
RecordChunk is a single-pass, bounded scan in one transaction. It implements Txish: pass the chunk to other table operations to join in the same snapshot. Records and their borrowed fields remain valid only within that transaction.
func (RecordChunk) Bookmark ¶ added in v0.4.13
func (c RecordChunk) Bookmark() ScanBookmark
Bookmark owns the last consumed position. An unconsumed chunk returns its starting bookmark. Capture it before closing the transaction.
func (RecordChunk) Count ¶ added in v0.4.13
func (c RecordChunk) Count() int
Count returns the number of entries consumed from this chunk, including entries rejected by application filters.
func (*RecordChunk[Key]) Entries ¶ added in v0.4.13
func (c *RecordChunk[Key]) Entries() iter.Seq2[Key, kvo.Record]
func (*RecordChunk[Key]) Keys ¶ added in v0.4.13
func (c *RecordChunk[Key]) Keys() iter.Seq[Key]
func (RecordChunk) More ¶ added in v0.4.13
func (c RecordChunk) More() bool
More finishes the chunk and checks for another matching entry without loading its row. After More, iteration is no longer allowed; Bookmark remains usable. This is a statement about this transaction's snapshot, not future writes.
type RecordEdit ¶ added in v0.4.13
type RecordEdit struct {
// contains filtered or unexported fields
}
RecordEdit holds a private edit of the row as it was opened in this write transaction. SaveRecord updates its revision so it can be saved again.
func (*RecordEdit) Delete ¶ added in v0.4.13
func (e *RecordEdit) Delete(p interface{ Code() uint64 })
func (*RecordEdit) EditOrCreate ¶ added in v0.4.13
func (*RecordEdit) Editor ¶ added in v0.4.13
func (e *RecordEdit) Editor() *kvo.Editor
func (*RecordEdit) Get ¶ added in v0.4.13
func (e *RecordEdit) Get[T any, P kvo.Property[T]](p P) T
Get and Set access an edit's typed properties directly. Editor exposes the underlying editor for advanced path and collection operations.
func (*RecordEdit) Has ¶ added in v0.4.13
func (e *RecordEdit) Has(p interface{ Code() uint64 }) bool
func (*RecordEdit) List ¶ added in v0.4.13
func (e *RecordEdit) List[E any, P kvo.ListProperty[E]](p P) E
func (*RecordEdit) Map ¶ added in v0.4.13
func (e *RecordEdit) Map[K comparable, V any](p *kvo.MapPropRef[K, V]) *kvo.MapEditor[K, V]
func (*RecordEdit) Record ¶ added in v0.4.13
func (e *RecordEdit) Record() kvo.Record
func (*RecordEdit) Set ¶ added in v0.4.13
func (e *RecordEdit) Set[T any, P kvo.Property[T]](p P, value T)
func (*RecordEdit) Table ¶ added in v0.4.13
func (e *RecordEdit) Table() *TableDef
type RecordScan ¶ added in v0.4.13
type RecordScan[Key any] struct { // contains filtered or unexported fields }
RecordScan is a reusable scan description. Each iteration opens a fresh cursor in the same transaction. Records borrow their transaction's storage; retain them beyond it only after Record.Own. Keys are decoded values.
func (RecordScan[Key]) Chunk ¶ added in v0.4.13
func (s RecordScan[Key]) Chunk(limit int) *RecordChunk[Key]
Chunk opens a single-pass cursor yielding at most limit entries. Unlike a reusable scan, repeated iterations continue the same chunk. limit must be positive. Call Bookmark and More before closing the transaction to resume in a later transaction. Use ReadChunks to manage that loop automatically.
func (RecordScan[Key]) Entries ¶ added in v0.4.13
func (s RecordScan[Key]) Entries() iter.Seq2[Key, kvo.Record]
func (RecordScan) KeyCursor ¶ added in v0.4.13
func (s RecordScan) KeyCursor() *KeyCursor[Key]
KeyCursor opens an independent key-only cursor. Table scans and exact index scans can be merged with Union or Intersect (subject to the key ordering check described on Union). A general index scan is ordered by index key first, so it cannot be merged directly even when its primary keys happen to look sorted in a small sample.
func (RecordScan) Keys ¶ added in v0.4.13
Keys decodes primary keys without loading or decoding row payloads.
func (RecordScan) Raw ¶ added in v0.4.13
func (s RecordScan) Raw() RawCursor
Raw opens a cursor for low-level operations. It does not consume an earlier iteration; all scans and iterators must stay inside their transaction.
func (RecordScan[Key]) Records ¶ added in v0.4.13
func (s RecordScan[Key]) Records() iter.Seq[kvo.Record]
func (RecordScan[Key]) Resume ¶ added in v0.4.13
func (s RecordScan[Key]) Resume(b ScanBookmark) RecordScan[Key]
func (RecordScan[Key]) Reversed ¶ added in v0.4.13
func (s RecordScan[Key]) Reversed() RecordScan[Key]
type RecordStorage ¶ added in v0.4.13
type RecordStorage struct {
// MessagePackInserts deploys the dual reader before enabling KVO on new keys.
MessagePackInserts bool
Format StorageFormat
Mode nativebind.Mode
Generated *kvo.Generated
}
RecordStorage selects Fast2 or Compact2 for new keys. Format must be explicit. Existing keys keep their envelope version until UpgradeRecord converts them in a write transaction.
type ReplicationApplyOptions ¶ added in v0.4.17
ReplicationApplyOptions accepts complete groups from a consumer-validated history. Apply never invokes row migrators or captures a new local change group.
type ReplicationCaptureOptions ¶ added in v0.4.17
type ReplicationCaptureOptions struct {
BestEffort bool
NextTransactionID func(lastCommittedID uint64) (uint64, error)
SchemaRev uint64
Include func(ReplicationObject) bool
// Shard resolves one stable shard per object/key. Empty success means global;
// unknown attribution must return an error. Missing raw deletes pass Present=false.
Shard func(ReplicationObject, []byte, ReplicationValue) ([]byte, error)
Sink ReplicationSink
}
type ReplicationChange ¶ added in v0.4.17
type ReplicationChange struct {
Object ReplicationObject
Op ReplicationOp
Ordinal uint64
Key []byte
Value ReplicationValue
Shard []byte
}
type ReplicationGroup ¶ added in v0.4.17
type ReplicationGroup struct {
TransactionID uint64
SchemaRev uint64
Changes []ReplicationChange
}
type ReplicationObject ¶ added in v0.4.17
ReplicationObject carries local table/map descriptors for stable wire IDs. A replication log decoder must resolve wire IDs to destination descriptors before ApplyReplication.
func (ReplicationObject) Kind ¶ added in v0.4.17
func (o ReplicationObject) Kind() ReplicationObjectKind
func (ReplicationObject) NameHash ¶ added in v0.4.17
func (o ReplicationObject) NameHash() uint64
NameHash returns the registered object's cached schema hash. Invalid or ambiguous descriptors panic, rather than silently selecting an object kind.
type ReplicationObjectKind ¶ added in v0.4.17
type ReplicationObjectKind uint8
const ( ReplicationInvalidObject ReplicationObjectKind = iota ReplicationRowTable ReplicationKVTable ReplicationSingletonMap )
type ReplicationOp ¶ added in v0.4.17
type ReplicationOp uint8
const ( ReplicationPut ReplicationOp = iota + 1 ReplicationDelete )
type ReplicationOptions ¶ added in v0.4.17
type ReplicationOptions struct {
Capture *ReplicationCaptureOptions
Apply *ReplicationApplyOptions
}
ReplicationOptions enables independent capture and apply capabilities. Neither capability changes local-write or row-migration policy. Nil disables both. Open copies these options; callbacks and descriptors must remain immutable.
type ReplicationPoisoner ¶ added in v0.4.17
type ReplicationPoisoner interface {
Poison(error)
}
type ReplicationReservation ¶ added in v0.4.17
type ReplicationReservation interface {
Stage(ReplicationChange) (ReplicationChange, error)
Publish(transactionID, schemaRev uint64)
Cancel()
}
type ReplicationSink ¶ added in v0.4.17
type ReplicationSink interface {
// Reserve must enqueue a pending slot before returning. Fail admission instead
// of waiting for the current transaction's commit/drain. No I/O or DB reentry.
Reserve() (ReplicationReservation, error)
// Drain runs after write admission stops. Wait for all accepted slots to resolve,
// consume them in order, and durably sync. Final Publish/Cancel calls may overlap.
Drain() error
}
ReplicationSink admits physical capture attempts into one database's ordered queue. EDB calls Reserve synchronously under Bolt's serialized writer, so successful reservation order is physical-attempt order, before commit. Publications/cancellations may arrive later and out of order. Consume slots strictly in reservation order, waiting for pending heads and skipping cancelled ones; sorting only groups already published does not establish a safe prefix. Exactly one Publish or Cancel follows each successful reservation in normal process execution. See _docs/REPLICATION-CONSUMER-CONTRACT.md for the full contract.
type ReplicationValue ¶ added in v0.4.17
type ReplicationValue struct {
Present bool
Flags uint64
SchemaVer uint64
ModCount uint64
Data []byte
}
ReplicationValue excludes the stored row's local index tail. Present distinguishes a missing value from a singleton's empty/nil PUT. Flags identifies the row codec.
type RowChunk ¶ added in v0.4.13
type RowChunk[Row, Key any] struct { // contains filtered or unexported fields }
RowChunk is the native-row counterpart of RecordChunk. Rows are decoded owned values; the chunk itself still belongs to its transaction.
func (RowChunk) Bookmark ¶ added in v0.4.13
func (c RowChunk) Bookmark() ScanBookmark
Bookmark owns the last consumed position. An unconsumed chunk returns its starting bookmark. Capture it before closing the transaction.
func (RowChunk) Count ¶ added in v0.4.13
func (c RowChunk) Count() int
Count returns the number of entries consumed from this chunk, including entries rejected by application filters.
func (RowChunk) More ¶ added in v0.4.13
func (c RowChunk) More() bool
More finishes the chunk and checks for another matching entry without loading its row. After More, iteration is no longer allowed; Bookmark remains usable. This is a statement about this transaction's snapshot, not future writes.
type RowMigrationPolicy ¶ added in v0.4.17
type RowMigrationPolicy uint8
RowMigrationPolicy controls row transforms during startup, decode and reindex. Skipping row migrations still permits local DDL and index-only backfills.
const ( AllowRowMigrations RowMigrationPolicy = iota SkipRowMigrations )
func (RowMigrationPolicy) String ¶ added in v0.4.17
func (p RowMigrationPolicy) String() string
type RowScan ¶ added in v0.4.13
type RowScan[Row, Key any] struct { // contains filtered or unexported fields }
RowScan uses the same scan rules but materializes owned native Go rows.
func (RowScan) KeyCursor ¶ added in v0.4.13
func (s RowScan) KeyCursor() *KeyCursor[Key]
KeyCursor opens an independent key-only cursor. Table scans and exact index scans can be merged with Union or Intersect (subject to the key ordering check described on Union). A general index scan is ordered by index key first, so it cannot be merged directly even when its primary keys happen to look sorted in a small sample.
func (RowScan) Keys ¶ added in v0.4.13
Keys decodes primary keys without loading or decoding row payloads.
func (RowScan) Raw ¶ added in v0.4.13
func (s RowScan) Raw() RawCursor
Raw opens a cursor for low-level operations. It does not consume an earlier iteration; all scans and iterators must stay inside their transaction.
func (RowScan[Row, Key]) Resume ¶ added in v0.4.13
func (s RowScan[Row, Key]) Resume(b ScanBookmark) RowScan[Row, Key]
type RowTable ¶ added in v0.4.13
type RowTable[Row, Key any] struct { // contains filtered or unexported fields }
RowTable is the native Go row counterpart of Table.
func (RowTable[Row, Key]) ExactIndexScan ¶ added in v0.4.13
func (RowTable[Row, Key]) Get ¶ added in v0.4.13
Get returns an owned native row, or nil when the key is absent.
func (RowTable[Row, Key]) IndexScanAfter ¶ added in v0.4.13
func (RowTable[Row, Key]) IndexScanBefore ¶ added in v0.4.13
func (RowTable[Row, Key]) IndexScanFrom ¶ added in v0.4.13
func (RowTable[Row, Key]) IndexScanThrough ¶ added in v0.4.13
func (RowTable[Row, Key]) PrefixIndexScan ¶ added in v0.4.13
func (RowTable[Row, Key]) RangeIndexScan ¶ added in v0.4.13
type SKey ¶
type SKey[T any] struct { // contains filtered or unexported fields }
SKey identifies a singleton storing a value of type T. SGet and SPut carry this type through to their destination and source arguments.
func AddSingletonKey ¶
AddSingletonKey declares a singleton's value type. A key can be declared only once within a map, even if a second declaration uses the same value type.
type ScanBookmark ¶ added in v0.4.13
type ScanBookmark struct {
// contains filtered or unexported fields
}
ScanBookmark is an owned, immutable position in a table or index scan. Its zero value starts at the beginning. It can outlive the cursor and transaction. Nonunique index positions include both the index key and primary key; a primary key alone cannot resume a general index scan.
A bookmark belongs to its table/index and traversal direction. Resume keeps the new scan's bounds, so it can also narrow the original query. Bookmarks are tied to in-process table/index definitions and have no serialization format; their position bytes are owned and can outlive transactions. They are not durable pagination tokens or snapshots. Between read transactions, inserts behind the position are missed and entries moved ahead of it can be visited again. Collect keys first when changing a scanned index.
func (ScanBookmark) IsZero ¶ added in v0.4.13
func (b ScanBookmark) IsZero() bool
type ScanMethod ¶
type ScanMethod int
type ScanOptions ¶
type ScanOptions struct {
Reverse bool
Method ScanMethod
PrefixValue reflect.Value
PrefixEls int
Lower reflect.Value
Upper reflect.Value
LowerInc bool
UpperInc bool
LowerPrimaryKey reflect.Value
UpperPrimaryKey reflect.Value
// contains filtered or unexported fields
}
func ExactIDRangeScan ¶ added in v0.3.1
func ExactIDRangeScan(exact, lower, upper any, lowerInc, upperInc bool) ScanOptions
func ExactIDRangeScanVal ¶ added in v0.3.1
func ExactIDRangeScanVal(exact, lower, upper reflect.Value, lowerInc, upperInc bool) ScanOptions
func ExactScan ¶
func ExactScan(v any) ScanOptions
func ExactScanVal ¶
func ExactScanVal(val reflect.Value) ScanOptions
func FullScan ¶
func FullScan() ScanOptions
func LowerBoundScan ¶ added in v0.2.0
func LowerBoundScan(lower any, includeEqual bool) ScanOptions
func RangeScan ¶ added in v0.1.6
func RangeScan(lower, upper any, lowerInc, upperInc bool) ScanOptions
func RangeScanVal ¶ added in v0.1.6
func RangeScanVal(lower, upper reflect.Value, lowerInc, upperInc bool) ScanOptions
func UpperBoundScan ¶ added in v0.2.0
func UpperBoundScan(upper any, includeEqual bool) ScanOptions
func (ScanOptions) LogString ¶ added in v0.1.2
func (so ScanOptions) LogString() string
func (ScanOptions) Prefix ¶
func (so ScanOptions) Prefix(els int) ScanOptions
func (ScanOptions) PrimaryKeyRange ¶ added in v0.4.8
func (so ScanOptions) PrimaryKeyRange(lower, upper any, lowerInc, upperInc bool) ScanOptions
PrimaryKeyRange restricts the primary keys at the index range's endpoints. It does not specify a physical continuation position. Use Resume for paging: variable-width index keys can interleave, so logical endpoint restrictions may need to visit entries before a complete index-key/primary-key seek.
func (ScanOptions) PrimaryKeyRangeVal ¶ added in v0.4.8
func (so ScanOptions) PrimaryKeyRangeVal(lower, upper reflect.Value, lowerInc, upperInc bool) ScanOptions
func (ScanOptions) Resume ¶ added in v0.4.13
func (so ScanOptions) Resume(b ScanBookmark) ScanOptions
Resume continues exclusively after the bookmark in traversal order, retaining all query bounds. A zero bookmark leaves the scan unchanged.
func (ScanOptions) Reversed ¶
func (so ScanOptions) Reversed() ScanOptions
type Schema ¶
type Schema struct {
Name string
// contains filtered or unexported fields
}
func (*Schema) Include ¶ added in v0.1.3
Include composes all table families and singleton maps without modifying peer. A conflicting declaration panics and leaves the receiving schema unchanged.
func (*Schema) KVMapByNameHash ¶ added in v0.4.17
KVMapByNameHash returns nil for an unknown hash or another object kind.
func (*Schema) KVTableByNameHash ¶ added in v0.4.17
KVTableByNameHash returns nil for an unknown hash or another object kind.
func (*Schema) KVTableNamed ¶ added in v0.3.2
func (*Schema) NameHash ¶ added in v0.4.17
NameHash returns the cached hash of a registered table, KV table or singleton map. Lookup is case-insensitive, like TableNamed; an unknown name panics.
func (*Schema) TableByNameHash ¶ added in v0.4.17
TableByNameHash returns nil for an unknown hash or another object kind.
func (*Schema) TableByRow ¶ added in v0.1.2
func (*Schema) TableByRowType ¶ added in v0.1.2
func (*Schema) TableNamed ¶
type StorageFormat ¶ added in v0.4.13
type StorageFormat uint8
StorageFormat names payload encodings, not row-envelope versions. Fast1 and MessagePack remain supported; new storage should use Fast2 or Compact2.
const ( MessagePack StorageFormat = iota Fast1 Fast2 Compact2 )
func (StorageFormat) String ¶ added in v0.4.13
func (f StorageFormat) String() string
type Table ¶
type Table[Key any] struct { // contains filtered or unexported fields }
Table is a table's encoding-independent access API with a declared key type. DefineTable constructs it together with its shared definition.
func DefineTable ¶ added in v0.2.0
func DefineTable[Key any](scm *Schema, name string, model *kvo.Model, f func(b *TableBuilder[Key])) *Table[Key]
DefineTable registers a model-backed table. The model's first registered Go struct supplies native storage and its first field supplies the primary key. Key must exactly match that field's type. The schema version defaults to 1. SetRecordStorage selects Fast2 or Compact2 instead of MessagePack for new keys.
func (Table[Key]) After ¶ added in v0.4.13
func (t Table[Key]) After(txh Txish, key Key) RecordScan[Key]
func (Table[Key]) Before ¶ added in v0.4.13
func (t Table[Key]) Before(txh Txish, key Key) RecordScan[Key]
func (Table[Key]) Edit ¶ added in v0.4.13
func (t Table[Key]) Edit(txh Txish, key Key) *RecordEdit
Edit opens a private edit in the current write transaction, or returns nil.
func (Table[Key]) EditOrCreate ¶ added in v0.4.13
func (t Table[Key]) EditOrCreate(txh Txish, key Key) *RecordEdit
EditOrCreate opens the existing row or prepares an insert under this key.
func (Table[Key]) Exact ¶ added in v0.4.13
func (t Table[Key]) Exact(txh Txish, key Key) RecordScan[Key]
func (Table[Key]) ExactIndexScan ¶ added in v0.4.13
func (t Table[Key]) ExactIndexScan[IndexKey any](txh Txish, idx *Index[IndexKey], key IndexKey) RecordScan[Key]
func (Table[Key]) From ¶ added in v0.4.13
func (t Table[Key]) From(txh Txish, key Key) RecordScan[Key]
func (Table[Key]) Get ¶ added in v0.4.13
Get returns a borrowed record, or a missing record when the key is absent.
func (Table[Key]) GetRaw ¶ added in v0.4.13
GetRaw accepts an encoded primary key. The returned record does not retain it.
func (Table[Key]) IndexScan ¶ added in v0.4.13
func (t Table[Key]) IndexScan[IndexKey any](txh Txish, idx *Index[IndexKey]) RecordScan[Key]
func (Table[Key]) IndexScanAfter ¶ added in v0.4.13
func (t Table[Key]) IndexScanAfter[IndexKey any](txh Txish, idx *Index[IndexKey], key IndexKey) RecordScan[Key]
func (Table[Key]) IndexScanBefore ¶ added in v0.4.13
func (t Table[Key]) IndexScanBefore[IndexKey any](txh Txish, idx *Index[IndexKey], key IndexKey) RecordScan[Key]
func (Table[Key]) IndexScanFrom ¶ added in v0.4.13
func (t Table[Key]) IndexScanFrom[IndexKey any](txh Txish, idx *Index[IndexKey], key IndexKey) RecordScan[Key]
func (Table[Key]) IndexScanThrough ¶ added in v0.4.13
func (t Table[Key]) IndexScanThrough[IndexKey any](txh Txish, idx *Index[IndexKey], key IndexKey) RecordScan[Key]
func (Table[Key]) Key ¶ added in v0.4.13
func (t Table[Key]) Key(edit *RecordEdit) Key
Key returns this edit's primary key, including when the model omits it.
func (Table[Key]) New ¶ added in v0.4.13
func (t Table[Key]) New(txh Txish, key Key) *RecordEdit
New prepares an insert; Save checks that the primary key is still free.
func (Table[Key]) Prefix ¶ added in v0.4.13
func (t Table[Key]) Prefix(txh Txish, key Key, components int) RecordScan[Key]
Prefix matches the first components of a composite key, using the declared key type. It is a tuple prefix, not a string prefix.
func (Table[Key]) PrefixIndexScan ¶ added in v0.4.13
func (Table[Key]) Put ¶ added in v0.4.13
Put inserts or replaces a record under an explicit key and reports a change. Use PutChecked when replacing a previously read revision conditionally.
func (Table[Key]) PutChecked ¶ added in v0.4.13
PutChecked replaces only the expected revision (zero metadata means insert).
func (Table[Key]) Range ¶ added in v0.4.13
func (t Table[Key]) Range(txh Txish, lower, upper Key) RecordScan[Key]
Range includes both endpoints. From/After and Through/Before provide inclusive/exclusive one-sided bounds; Reversed changes traversal order.
func (Table[Key]) RangeIndexScan ¶ added in v0.4.13
func (t Table[Key]) RangeIndexScan[IndexKey any](txh Txish, idx *Index[IndexKey], lower, upper IndexKey) RecordScan[Key]
func (Table[Key]) Save ¶ added in v0.4.13
func (t Table[Key]) Save(txh Txish, edit *RecordEdit) bool
func (Table[Key]) Scan ¶ added in v0.4.13
func (t Table[Key]) Scan(txh Txish) RecordScan[Key]
func (Table[Key]) Through ¶ added in v0.4.13
func (t Table[Key]) Through(txh Txish, key Key) RecordScan[Key]
func (Table[Key]) TryEdit ¶ added in v0.4.13
func (t Table[Key]) TryEdit(txh Txish, key Key) (*RecordEdit, error)
func (Table[Key]) TryEditOrCreate ¶ added in v0.4.13
func (t Table[Key]) TryEditOrCreate(txh Txish, key Key) (*RecordEdit, error)
func (Table[Key]) TryNew ¶ added in v0.4.13
func (t Table[Key]) TryNew(txh Txish, key Key) (*RecordEdit, error)
func (Table[Key]) TryPutChecked ¶ added in v0.4.13
type TableBuilder ¶ added in v0.2.0
type TableBuilder[Key any] struct { // contains filtered or unexported fields }
func (*TableBuilder[Key]) AddIndex ¶ added in v0.2.0
func (b *TableBuilder[Key]) AddIndex[T any](name string, indexer func(tx *Tx, pk values.Value, row kvo.Record, yield func(T)), opts ...any) *Index[T]
AddIndex registers an index on this table and returns it. The optional callback yields keys of T. A nil callback leaves population to TableBuilder.SetIndexer. Both forms may coexist. Callbacks share the write transaction; records, primary-key cells, and yield are borrowed and must not be mutated or retained. The primary key uses the shared native-value ABI; use AsUint/AsString or IndexPrimaryKey[T].
func (*TableBuilder[Key]) AddMigrator ¶ added in v0.4.13
func (b *TableBuilder[Key]) AddMigrator(toVer uint64, f func(tx *Tx, key Key, edit *kvo.Editor))
AddMigrator runs f when the stored version is below toVer. Eligible callbacks run in registration order, each comparing against the original stored version. toVer must be positive and no greater than the final table schema version. Native editors update structs in place; encoded editors preserve untouched fields. Reads do not persist migrations; saves and reindexing do. The callback must not change the primary key or retain the editor.
func (*TableBuilder[Key]) SetIndexer ¶ added in v0.4.13
func (b *TableBuilder[Key]) SetIndexer(f func(Key, kvo.Record, *IndexBuilder))
SetIndexer builds secondary indexes from logical properties on any row format. The primary key is supplied separately; records need no stored key property. The record and its bytes are borrowed, read-only, and valid only during f. Use a presence-significant property when absent and zero index differently.
func (*TableBuilder[Key]) SetNativeSchema ¶ added in v0.4.13
func (b *TableBuilder[Key]) SetNativeSchema(schema kvo.NativeSchema)
SetNativeSchema shares native field operations and value types with the host VM.
func (*TableBuilder[Key]) SetRecordStorage ¶ added in v0.4.13
func (b *TableBuilder[Key]) SetRecordStorage(storage RecordStorage)
func (*TableBuilder[Key]) SetSchemaVersion ¶ added in v0.2.0
func (b *TableBuilder[Key]) SetSchemaVersion(ver uint64)
func (*TableBuilder[Key]) SuppressContentWhenLogging ¶ added in v0.2.0
func (b *TableBuilder[Key]) SuppressContentWhenLogging()
func (*TableBuilder[Key]) Tag ¶ added in v0.3.8
func (b *TableBuilder[Key]) Tag(tag *Tag)
type TableDef ¶ added in v0.4.13
type TableDef struct {
TaggableImpl
// contains filtered or unexported fields
}
func (*TableDef) DecodeKeyVal ¶ added in v0.4.13
func (*TableDef) DecodeKeyValInto ¶ added in v0.4.13
func (*TableDef) EncodeKeyVal ¶ added in v0.4.13
func (*TableDef) IndexNamed ¶ added in v0.4.13
func (*TableDef) NameHash ¶ added in v0.4.17
NameHash returns xxHash64 of the lowercase registered name, cached at declaration.
func (*TableDef) ParseKeyVal ¶ added in v0.4.13
func (*TableDef) RawKeyString ¶ added in v0.4.13
func (*TableDef) RowHasZeroKey ¶ added in v0.4.13
func (*TableDef) RowValHasZeroKey ¶ added in v0.4.13
func (*TableDef) Rows ¶ added in v0.4.13
Rows validates both the native row type and the primary key type.
func (*TableDef) SchemaVersion ¶ added in v0.4.13
SchemaVersion is the version written by current saves. Stored rows may have older versions until they are loaded, migrated, and saved.
func (*TableDef) SetRowKeyVal ¶ added in v0.4.13
func (*TableDef) TryDecodeKeyValInto ¶ added in v0.4.13
func (*TableDef) TryRawKeyString ¶ added in v0.4.13
type TableError ¶
func (*TableError) Error ¶
func (e *TableError) Error() string
func (*TableError) Unwrap ¶
func (e *TableError) Unwrap() error
type TableStats ¶
type TableStats struct {
Rows int64
IndexRows int64
DataSize int64
DataAlloc int64
IndexSize int64
IndexAlloc int64
}
func (*TableStats) TotalAlloc ¶
func (ts *TableStats) TotalAlloc() int64
func (*TableStats) TotalSize ¶
func (ts *TableStats) TotalSize() int64
type TagFamily ¶ added in v0.3.8
type TagFamily struct {
// contains filtered or unexported fields
}
func NewTagFamily ¶ added in v0.3.8
func NewTagFamily(name string, tags []*Tag, defaultTag *Tag, card TagFamilyCardinality) *TagFamily
type TagFamilyCardinality ¶ added in v0.3.8
type TagFamilyCardinality int
const ( TagFamilyCardinalityOptionalOne TagFamilyCardinality = iota TagFamilyCardinalityRequiredOne TagFamilyCardinalityOptionalMany TagFamilyCardinalityRequiredMany )
type TaggableImpl ¶ added in v0.3.8
type TaggableImpl struct {
// contains filtered or unexported fields
}
func (*TaggableImpl) HasTag ¶ added in v0.3.8
func (i *TaggableImpl) HasTag(tag *Tag) bool
func (*TaggableImpl) TagInFamily ¶ added in v0.3.8
func (i *TaggableImpl) TagInFamily(fam *TagFamily) *Tag
type Tx ¶
type Tx struct {
// contains filtered or unexported fields
}
func (*Tx) BeginVerbose ¶ added in v0.2.0
func (tx *Tx) BeginVerbose()
func (*Tx) BoltTx ¶ added in v0.4.0
BoltTx returns the underlying Bolt transaction if this DB uses Bolt, otherwise nil.
func (*Tx) CommitDespiteError ¶
func (tx *Tx) CommitDespiteError()
func (*Tx) DecodeMementoVal ¶ added in v0.3.17
func (*Tx) DeleteByKeyVal ¶
func (*Tx) DeleteRecord ¶ added in v0.4.13
DeleteRecord derives the key from an explicitly declared model property. Use DeleteByKey when the record does not store its primary key.
func (*Tx) EditRecord ¶ added in v0.4.13
EditRecord opens, edits, and saves one record using the table's storage codec. A missing key is a no-op. Use NewRecordEdit to prepare an insert.
func (*Tx) EndVerbose ¶ added in v0.2.0
func (tx *Tx) EndVerbose()
func (*Tx) ExistsByKeyRaw ¶ added in v0.1.6
func (*Tx) GetByKeyRaw ¶ added in v0.1.6
func (*Tx) GetByKeyVal ¶
func (*Tx) GetMetaByKeyVal ¶
func (*Tx) GetRecord ¶ added in v0.4.13
GetRecord panics on error. Use TryGetRecord to handle errors explicitly.
func (*Tx) GetRecordByKeyRaw ¶ added in v0.4.13
GetRecordByKeyRaw panics on error. Use TryGetRecordByKeyRaw to handle errors explicitly.
func (*Tx) GetRecordByKeyVal ¶ added in v0.4.13
GetRecordByKeyVal accepts an existing reflected key without boxing it into an interface. It panics on error; TryGetRecordByKeyVal also returns metadata.
func (*Tx) IndexScan ¶
func (tx *Tx) IndexScan(idxArg AnyIndex, opt ScanOptions) *RawIndexCursor
func (*Tx) IsWritable ¶
func (*Tx) KVIndexScan ¶ added in v0.3.2
func (*Tx) KVTableScan ¶ added in v0.3.1
func (*Tx) KVTableStats ¶ added in v0.3.7
func (tx *Tx) KVTableStats(tbl *KVTable) TableStats
func (*Tx) LookupExists ¶ added in v0.2.0
func (*Tx) LookupKeyVal ¶
func (*Tx) Metadata ¶ added in v0.4.15
func (tx *Tx) Metadata() TxMetadata
func (*Tx) NewRecordEdit ¶ added in v0.4.13
func (tx *Tx) NewRecordEdit(tArg AnyTable, key any) *RecordEdit
NewRecordEdit panics on error. Use TryNewRecordEdit to handle errors explicitly.
func (*Tx) OnChange ¶ added in v0.1.4
func (tx *Tx) OnChange(opts map[*TableDef]ChangeFlags, f func(tx *Tx, chg *Change))
OnChange installs a transaction-local handler. Notifications run after each mutation, before commit (which may still roll back). No-op writes do not notify. Request old/new records or independently decoded Go structs explicitly; deletes have only an old value. Record notifications require a KVO model. The options map must not be modified while installed.
func (*Tx) OpenRecordEdit ¶ added in v0.4.13
func (tx *Tx) OpenRecordEdit(tArg AnyTable, key any) *RecordEdit
OpenRecordEdit panics on error. Use TryOpenRecordEdit to handle errors explicitly.
func (*Tx) PutByKey ¶ added in v0.4.13
PutByKey inserts or replaces a row using an explicit database key. KVO records need no key property. A native Go row is shallow-copied before its key field is set, so the caller's struct is not changed.
func (*Tx) PutRecordChecked ¶ added in v0.4.13
PutRecordChecked panics on error. Use TryPutRecordChecked to handle errors explicitly.
func (*Tx) SaveRecord ¶ added in v0.4.13
func (tx *Tx) SaveRecord(e *RecordEdit)
SaveRecord panics on error. Use TrySaveRecord to handle errors explicitly.
func (*Tx) TableScan ¶
func (tx *Tx) TableScan(tblArg AnyTable, opt ScanOptions) *RawTableCursor
func (*Tx) TableStats ¶
func (tx *Tx) TableStats(tblArg AnyTable) TableStats
func (*Tx) TryEditRecord ¶ added in v0.4.13
func (tx *Tx) TryEditRecord(tArg AnyTable, key any, edit func(*kvo.Editor) error) (ValueMeta, error)
TryEditRecord discards the edit if the callback returns an error. It checks for intervening writes before saving, just like an explicitly opened edit.
func (*Tx) TryGetByKeyVal ¶ added in v0.2.1
func (*Tx) TryGetRecord ¶ added in v0.4.13
TryGetRecord borrows the row payload and selects its codec. Fastest can decode once for repeated access. Migrations and custom object codecs may decode eagerly.
func (*Tx) TryGetRecordByKeyRaw ¶ added in v0.4.13
TryGetRecordByKeyRaw accepts an already encoded key. The result borrows only the stored payload, not this key. A transaction reuses one lookup cursor per table.
func (*Tx) TryGetRecordByKeyVal ¶ added in v0.4.13
func (*Tx) TryNewRecordEdit ¶ added in v0.4.13
func (tx *Tx) TryNewRecordEdit(tArg AnyTable, key any) (*RecordEdit, error)
TryNewRecordEdit prepares an insert. The table's insert policy selects the backing representation. SaveRecord rechecks that the key is still free.
func (*Tx) TryOpenRecordEdit ¶ added in v0.4.13
func (tx *Tx) TryOpenRecordEdit(tArg AnyTable, key any) (*RecordEdit, error)
TryOpenRecordEdit returns nil without error when the key is missing.
func (*Tx) TryPutRecordChecked ¶ added in v0.4.13
func (tx *Tx) TryPutRecordChecked(tArg AnyTable, key any, row kvo.Record, expected ValueMeta) (ValueMeta, error)
TryPutRecordChecked inserts or replaces a record using an explicit primary key. expected is the revision from GetRecord, or zero metadata for an insert. The existing row's storage codec is preserved; new keys follow table policy.
func (*Tx) TrySaveRecord ¶ added in v0.4.13
func (tx *Tx) TrySaveRecord(e *RecordEdit) (ValueMeta, error)
func (*Tx) TryUpgradeRecord ¶ added in v0.4.13
TryUpgradeRecord changes only the envelope version and payload. Index bytes, revision and schema version remain intact. Repeating it is a no-op.
func (*Tx) UnsafeDeleteByKeyRawSkippingIndex ¶ added in v0.1.4
type TxMetadata ¶ added in v0.4.15
type TxObservation ¶ added in v0.4.15
type TxObservation struct {
Metadata TxMetadata
Writable bool
Duration time.Duration
}
type ValueMeta ¶
func (ValueMeta) IsModified ¶ added in v0.2.3
Source Files
¶
- byteutil.go
- change.go
- db.go
- debug.go
- doc.go
- encflat.go
- encflat_typed.go
- encindexkeys.go
- encoding.go
- enctuple.go
- encvalue.go
- errors.go
- index.go
- indexkey.go
- monitoring.go
- opdelete.go
- opget.go
- opimpl.go
- opimpldecode.go
- opkv.go
- oplookup.go
- opmaint.go
- opput.go
- ops.go
- opscan.go
- opscan_chunks.go
- opscan_keys.go
- opscan_resume.go
- opscan_typed.go
- optyped.go
- pools.go
- record_access.go
- record_storage.go
- reflect.go
- replication.go
- replication_apply.go
- replication_best_effort.go
- scan.go
- schema.go
- schema_any.go
- schema_index_typed.go
- schema_namehash.go
- schema_typed.go
- schemabuilder.go
- schemaindex.go
- schemakvindex.go
- schemakvo.go
- schemastate.go
- schematable.go
- storage.go
- storage_bolt.go
- storage_mem.go
- storageformat.go
- tags.go
- tx.go
- tx_observation.go
- upgrade_compare.go
- util.go
- writepolicy.go
Directories
¶
| Path | Synopsis |
|---|---|
|
Package edbindexing supplies typed index callbacks for common property reads.
|
Package edbindexing supplies typed index callbacks for common property reads. |
|
Package evm implements a register VM for compiled Go programs.
|
Package evm implements a register VM for compiled Go programs. |
|
bench/internal/mathwork
Package mathwork holds the independent numeric workloads.
|
Package mathwork holds the independent numeric workloads. |
|
bench/internal/optwork
Package optwork holds workloads compiled by both Go and EVM.
|
Package optwork holds workloads compiled by both Go and EVM. |
|
bench/internal/workload
Package workload contains shared fixtures for the EVM and Lua benchmarks.
|
Package workload contains shared fixtures for the EVM and Lua benchmarks. |
|
evmasm
Package evmasm assembles textual EVM code without a Go compiler.
|
Package evmasm assembles textual EVM code without a Go compiler. |
|
evmbind
Package evmbind builds a reusable EVM host schema from Go declarations.
|
Package evmbind builds a reusable EVM host schema from Go declarations. |
|
evmbind/cmd/evmbind
command
Command evmbind generates a package of native wrappers for an EVM API.
|
Command evmbind generates a package of native wrappers for an EVM API. |
|
evmbind/internal/methodfixture
Code generated by kvo.
|
Code generated by kvo. |
|
evmcompiler
Package evmcompiler compiles sequential Go 1.23 to EVM bytecode.
|
Package evmcompiler compiles sequential Go 1.23 to EVM bytecode. |
|
internal/genstdlib
command
|
|
|
examples
|
|
|
loyalty
command
This example uses a temporary database; it leaves no files behind.
|
This example uses a temporary database; it leaves no files behind. |
|
Package gox compiles GoX templates into typed EVM functions.
|
Package gox compiles GoX templates into typed EVM functions. |
|
internal
|
|
|
inlinerow
Code generated by kvo.
|
Code generated by kvo. |
|
inlinerow/gen
command
|
|
|
naming
Package naming defines identifier spelling rules for EDB frontends.
|
Package naming defines identifier spelling rules for EDB frontends. |
|
statrow
Code generated by kvo.
|
Code generated by kvo. |
|
statrow/gen
command
|
|
|
valuebench
Code generated by kvo.
|
Code generated by kvo. |
|
valuebench/gen
command
|
|
|
Package kvo defines logical models, typed properties, and record access and editing over MessagePack, Fast2, Compact2, native Go structs, and decoded memory.
|
Package kvo defines logical models, typed properties, and record access and editing over MessagePack, Fast2, Compact2, native Go structs, and decoded memory. |
|
codec/fast1
Package fast1 implements the original KVO word-map storage format.
|
Package fast1 implements the original KVO word-map storage format. |
|
codec/msgpack
Package msgpack implements EDB's MessagePack struct encoding.
|
Package msgpack implements EDB's MessagePack struct encoding. |
|
codec/row2
Package row2 reads and writes the Fast2 and Compact2 KVO row formats.
|
Package row2 reads and writes the Fast2 and Compact2 KVO row formats. |
|
Package nativebind selects native bindings once, when a schema is built.
|
Package nativebind selects native bindings once, when a schema is built. |
|
internal/fixture
Code generated by nativebind.
|
Code generated by nativebind. |
|
internal/generate
command
|
|
|
research
|
|
|
kvo/cmd/census
command
Census inventories table registration sites and reachable Go payload shapes.
|
Census inventories table registration sites and reachable Go payload shapes. |
|
kvo/draft
Package kvodraft is an executable draft of KVO's schema-independent framing.
|
Package kvodraft is an executable draft of KVO's schema-independent framing. |
|
kvo/experiments
Package kvolab contains disposable representation experiments, not a storage API.
|
Package kvolab contains disposable representation experiments, not a storage API. |
|
storage-audit-2026-11-12/_tools
command
|
|
|
storage-compat
command
Command storage-compat rehearses old/new/old persistence using a disposable DB.
|
Command storage-compat rehearses old/new/old persistence using a disposable DB. |
|
Package values defines two-word values shared by KVO adapters and EVM.
|
Package values defines two-word values shared by KVO adapters and EVM. |