Skip to main content

Transaction types

View

Read-only transaction. Pins MVCC read_seq at start when format v2 is enabled.

Update / Batch

Exclusive write lock. Logical writes via *Tx.
Batch is an alias for Update for naming parity.

MVCC snapshots

ViewAt

Pin a specific read_seq snapshot. Returns ErrReadSeqFuture if the sequence is too new.

ViewAtTime

Map wall-clock time to the latest commit ≤ as_of, then pin that snapshot.

Transaction properties

Writable

Returns true inside Update / Batch transactions.

Raw B+ tree operations

Get

Raw B+ tree get by byte key.

Put

Raw B+ tree put (requires Update).

AscendRange

Ordered scan over byte keys [from, to).

Snapshot tags

Human-friendly names for MVCC commit sequences.

TagSnapshot

Pin the current head CommitSeq under a label. Overwrites existing tags with the same name.
Label must be non-empty and ≤ 200 bytes.

ViewAtTag

Open a read-only snapshot pinned to a tag.
Returns ErrSnapshotTagNotFound if the label does not exist.

ListSnapshotTags

Return all tags sorted by label.

DeleteSnapshotTag

Remove a tag entry. Does not affect underlying data.

See also

  • Database — Database lifecycle
  • MVCC — Multi-version concurrency control