Skip to main content

Crate surrealdb_datastore

Crate surrealdb_datastore 

Source
Expand description

The SurrealDB datastore layer.

This crate owns the keyspace: which keys exist, and the durable shapes their values take. How a key encodes is one layer down, in surrealdb-kvs; what the engine does with a decoded value is one layer up.

This crate is an internal implementation detail of SurrealDB: its API is unstable and changes without notice. Depend on the surrealdb SDK or surrealdb-core instead.

Re-exports§

pub use error::DatastoreError;
pub use config::TransactionConfig;
pub use factory::ReadRequest;
pub use factory::TransactionFactory;
pub use feature::FeatureLevelCell;
pub use feature::FeatureLevelState;
pub use feature::LevelledMode;
pub use feature::Readable;
pub use into::IntoBytes;
pub use layouts::Admission;
pub use layouts::LayoutSet;
pub use layouts::RowGate;
pub use tr::Transactor;
pub use tx::DocIdsReclaimClaim;
pub use tx::Transaction;
pub use tx::WriteBatch;
pub use surrealdb_catalog as catalog;

Modules§

absence
Creates whose check that the key is absent is made for many keys at once.
api
This module defines the API for a transaction in a key-value store.
cache
catalog_reads
What a stretch of work reads of a transaction’s catalog.
clock
The wall-clock seam for time-dependent coordination state.
close
Work a layer above the datastore owes once a transaction’s outcome is known.
config
The transaction layer’s own knobs.
consts
creations
The records a transaction creates in the tables its writes are reading.
err
error
Failures raised by the datastore layer.
expr
The type definitions for the computation format of the surreaql executor.
factory
What opens a transaction.
feature
The store’s feature level, as a transaction sees it.
index_shapes
The value shapes a B-tree, spatial or vector index has stored, per column.
index_state
Reading durable index build state.
into
key
The engine’s keyspace: which keys exist, and what each one spells.
layouts
The generation check that a reader of stored records runs before it reads any field of a row.
out_of_line
A future polled through a function pointer taken where it was built.
pending_guard
The pending-state guards of a vector index, whatever its kind.
sequences
Distributed sequence and ID generation management.
speculation
A transaction’s writes held apart from its storage, for planning a program against what its own schema statements will do before they run.
tasklease
timestamp
tr
triggers
Wake-ups a committing transaction fires, and the count of its datastore’s catalog commits ([CatalogEpoch]).
tx
Transaction implementation and cache coordination.
unseen_indexes
The indexes a transaction cannot read.
util
val
values
The values the keyspace binds.
version

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.
Error
An error originating from the KVS (Key-Value Store) layer.
TransactionType
Specifies whether the transaction is read-only or writeable.

Constants§

NORMAL_BATCH_SIZE

Functions§

is_condition_not_met
Whether a failure is a conditional write reporting that the value it required was not there.
is_indeterminate_commit
Whether a failure reports a commit whose outcome is unknown — the transaction may or may not have been applied.
is_retryable_transaction_conflict
Whether a failure is a transaction conflict the caller may retry.
is_shutdown_error
Whether a failure reports that the storage engine is shutting down.
storage_error
Recover a storage failure from an anyhow::Error, whichever shape it took.

Type Aliases§

Result
Result type for KVS (Key-Value Store) layer operations
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.