Documentation ¶
Index ¶
- Variables
- func ToOrdered(v any) any
- func TypeMatch(v any, typ types.T) bool
- type Atomic
- type BTree
- type BTreeLog
- type Batch
- type BatchIter
- type Bool
- type BoundedIndexIter
- type Bytes
- type Decimal
- type Float
- type ID
- type IndexEntry
- type Int
- type Iter
- type KVPair
- type KVValue
- type Log
- type LogIter
- type Nullable
- type Ordered
- type Row
- type SeekIter
- type SliceLog
- type Table
- func (t *Table[K, V, R]) Delete(tx *Transaction, key K) (err error)
- func (t *Table[K, V, R]) DisableHistory()
- func (t *Table[K, V, R]) Dump(w io.Writer)
- func (t *Table[K, V, R]) EraseHistory(before Time)
- func (t *Table[K, V, R]) Get(tx *Transaction, key K) (value V, err error)
- func (t *Table[K, V, R]) Index(tx *Transaction, index Tuple) (entries []*IndexEntry[K, V], err error)
- func (t *Table[K, V, R]) Insert(tx *Transaction, row R) (err error)
- func (t *Table[K, V, R]) NewBatch(tx *Transaction) (*Batch[K, V, R], error)
- func (t *Table[K, V, R]) NewIndexIter(tx *Transaction, min Tuple, max Tuple) (Iter[*IndexEntry[K, V]], error)
- func (t *Table[K, V, R]) NewIter(tx *Transaction) (*TableIter[K, V], error)
- func (t *Table[K, V, R]) Update(tx *Transaction, row R) (err error)
- func (t *Table[K, V, R]) Upsert(tx *Transaction, row R) (err error)
- type TableIter
- type Text
- type Time
- type Transaction
- type TransactionState
- type Tree
- type TreeIter
- type TreeNode
- type Tuple
- type Uint
Constants ¶
This section is empty.
Variables ¶
var Max max
Max is a value that greater than all values except Max itself
var Min min
Min is a value that smaller than all values except Min itself
Functions ¶
Types ¶
type Atomic ¶
type Atomic[T any] struct { // contains filtered or unexported fields }
Atomic is type-safe wrapper of atomic.Value
type BTreeLog ¶ added in v0.7.0
func NewBTreeLog ¶ added in v0.7.0
type Batch ¶ added in v0.7.0
type Batch[ K Ordered[K], V any, R Row[K, V], ] struct { // contains filtered or unexported fields }
Batch represents a batch of operations that commit atomically
func (*Batch[K, V, R]) Commit ¶ added in v0.7.0
func (b *Batch[K, V, R]) Commit()
Commit commits the batch
type BoundedIndexIter ¶ added in v0.7.0
BoundedIndexIter wraps another index iter within bounds
func NewBoundedIndexIter ¶ added in v0.7.0
func (*BoundedIndexIter[K, V]) Close ¶ added in v0.7.0
func (i *BoundedIndexIter[K, V]) Close() error
Close closes the iter
func (*BoundedIndexIter[K, V]) First ¶ added in v0.7.0
func (i *BoundedIndexIter[K, V]) First() bool
First sets the cursor to the first index entry
func (*BoundedIndexIter[K, V]) Next ¶ added in v0.7.0
func (i *BoundedIndexIter[K, V]) Next() bool
Next reports whether next entry is valid
func (*BoundedIndexIter[K, V]) Read ¶ added in v0.7.0
func (i *BoundedIndexIter[K, V]) Read() (*IndexEntry[K, V], error)
Read returns the current entry
func (*BoundedIndexIter[K, V]) Seek ¶ added in v0.7.0
func (i *BoundedIndexIter[K, V]) Seek(pivot *IndexEntry[K, V]) bool
Seek seeks to the pivot
type IndexEntry ¶
IndexEntry represents an index entry
type Nullable ¶
Nullable represents a nullable value
func (Nullable) AppendVector ¶
AppendVector append the value to a vector
type SliceLog ¶ added in v0.7.0
func NewSliceLog ¶ added in v0.7.0
type Table ¶
type Table[ K Ordered[K], V any, R Row[K, V], ] struct { sync.Mutex // contains filtered or unexported fields }
Table represents a table
func (*Table[K, V, R]) Delete ¶
func (t *Table[K, V, R]) Delete( tx *Transaction, key K, ) ( err error, )
Delete deletes a row from the table
func (*Table[K, V, R]) DisableHistory ¶ added in v0.7.0
func (t *Table[K, V, R]) DisableHistory()
func (*Table[K, V, R]) EraseHistory ¶
EraseHistory erases history before specified time
func (*Table[K, V, R]) Get ¶
func (t *Table[K, V, R]) Get( tx *Transaction, key K, ) ( value V, err error, )
Get gets the value of a key
func (*Table[K, V, R]) Index ¶
func (t *Table[K, V, R]) Index(tx *Transaction, index Tuple) (entries []*IndexEntry[K, V], err error)
Index finds entry in table
func (*Table[K, V, R]) Insert ¶
func (t *Table[K, V, R]) Insert( tx *Transaction, row R, ) ( err error, )
Insert inserts a row to the table
func (*Table[K, V, R]) NewBatch ¶ added in v0.7.0
func (t *Table[K, V, R]) NewBatch(tx *Transaction) (*Batch[K, V, R], error)
NewBatch creates a new batch for tx
func (*Table[K, V, R]) NewIndexIter ¶
func (t *Table[K, V, R]) NewIndexIter(tx *Transaction, min Tuple, max Tuple) (Iter[*IndexEntry[K, V]], error)
NewIndexIter creates new index iter
func (*Table[K, V, R]) NewIter ¶
func (t *Table[K, V, R]) NewIter(tx *Transaction) (*TableIter[K, V], error)
NewIter creates a new iter
func (*Table[K, V, R]) Update ¶
func (t *Table[K, V, R]) Update( tx *Transaction, row R, ) ( err error, )
Update updates a row in the table
func (*Table[K, V, R]) Upsert ¶
func (t *Table[K, V, R]) Upsert( tx *Transaction, row R, ) ( err error, )
Upsert update a row in the table or insert the row to the table if not exists
type TableIter ¶
TableIter represents an iter over a table
type Transaction ¶
type Transaction struct { State *Atomic[TransactionState] BeginTime Time // contains filtered or unexported fields }
Transaction represents a transaction a transaction may contains multiple operations on multiple tables a transaction commits atomically
func NewTransaction ¶
func NewTransaction( beginTime Time, ) *Transaction
NewTransaction creates a new transaction using beginTime as snapshot time
func (*Transaction) Commit ¶
func (t *Transaction) Commit(commitTime Time) error
Commit commits the transaction
type TransactionState ¶
type TransactionState uint8
TransactionState represents state of a transaction
const ( // Active is the default state of a newly created transaction Active TransactionState = iota // Committed is the state of a committed transaction Committed // Aborted is the state of a aborted transaction Aborted )
func (TransactionState) String ¶
func (t TransactionState) String() string
String returns the text form of a state
type TreeNode ¶ added in v0.7.0
type TreeNode[ K Ordered[K], V any, ] struct { IndexEntry *IndexEntry[K, V] KVPair *KVPair[K, V] }