Skip to main content

Crate surrealdb_kvs

Crate surrealdb_kvs 

Source
Expand description

§SurrealDB KVS

Common types and traits shared by every SurrealDB key-value store backend: the Transactable transaction trait, the TransactionBuilder datastore abstraction, the raw Key/KeyRange/Val byte types, the key/value encoding contract a typed key and its stored value are written against, and the shared error, configuration, cursor, and timestamp machinery.

This crate defines how a key and a value are declared; it does not declare any. Which keys exist is the keyspace, which lives above it.

Unstable!

This crate is SurrealDB internal API. It does not adhere to SemVer and its API is free to change and break code even between patch versions. If you are looking for a stable interface to the SurrealDB library please have a look at the Rust SDK.

Re-exports§

pub use api::Batch;
pub use api::CountCost;
pub use api::GetMultiResult;
pub use api::KeysResult;
pub use api::RangeKeyVisitor;
pub use api::ScanCursorKeys;
pub use api::ScanCursorVals;
pub use api::ScanResult;
pub use api::Transactable;
pub use builder::Metric;
pub use builder::Metrics;
pub use builder::TransactionBuilder;
pub use destroy::DestroyRange;
pub use destroy::DestroyRangeHandle;
pub use err::Error;
pub use err::Result;
pub use isolation::Isolation;
pub use isolation::IsolationLevels;
pub use isolation::IsolationLevelsHandle;
pub use maintenance::Maintenance;
pub use maintenance::MaintenanceHandle;
pub use page::Page;
pub use release::FeatureLevel;
pub use release::Release;
pub use savepoint::SavepointStack;
pub use snapshot::RangeCursor;
pub use snapshot::Resume;
pub use snapshot::Snapshot;
pub use split::Estimate;
pub use split::SplitTarget;
pub use stale::MAX_POSITION_BYTES;
pub use stale::ReadOutcome;
pub use stale::ReadSnapshotRequest;
pub use stale::SnapshotInfo;
pub use stale::SnapshotPosition;
pub use stale::StaleReads;
pub use stale::StaleReadsHandle;
pub use value::EncodeContext;
pub use value::Encoded;

Modules§

api
This module defines the API for a transaction in a key-value store.
builder
The datastore-level abstraction implemented by every storage backend: creating transactions, shutting down, and reporting metrics.
config
consts
cursor
The default resume-by-bound scan cursor.
destroy
Out-of-transaction range destruction: the optional backend capability that drops a whole key range in one call instead of one write per key.
err
isolation
Isolation levels a transaction can be opened at, and the optional backend capability that offers more than the default.
key
The traits a storage key is written against.
maintenance
Backend maintenance: the optional capability a backend offers when it keeps MVCC versions and transactional locks that the engine must periodically reclaim on its behalf.
page
A caller-owned buffer a RangeCursor copies entries into.
release
Releases and the store-wide feature level.
savepoint
Savepoint bookkeeping for backends built on a native engine savepoint.
snapshot
An owned, shareable read view of one transaction, and the cursors that read through it.
split
Dividing a key range into parts that are read independently, and estimating what a range holds.
stale
Bounded-staleness reads: the optional backend capability that serves a read-only transaction from an already-published snapshot.
threadpool
The shared KVS blocking threadpool used by embedded storage backends to run synchronous storage work off the async runtime.
timestamp
value
Values stored against keys: the encoding contract the datastore layer and every stored type agree on.

Macros§

impl_kv_value_revisioned
Implements KVValue for a type whose value bytes are its revisioned encoding.

Structs§

Key
A key type for indexing into a key value store.
KeyRange
A range of KVStore keys.

Enums§

Direction
The direction of a scan over a key range.
TransactionType
Specifies whether the transaction is read-only or writeable.

Type Aliases§

Val
The value part of a key-value pair. An alias for Vec<u8>.
Version
The Version part of a key-value pair. An alias for u64.