surrealdb_core/kvs/mod.rs
1//! The module defining the key value store.
2//! Everything related the transaction for the key value store is defined in the `tx.rs` file.
3//! This module enables the following operations on the key value store:
4//! - get
5//! - set
6//! - delete
7//! - put
8//!
9//! These operations can be processed by the following storage engines:
10//! - `fdb`: [FoundationDB](https://github.com/apple/foundationdb/) a distributed database designed to handle large volumes of structured data across clusters of commodity servers
11//! - `indxdb`: WASM based database to store data in the browser
12//! - `rocksdb`: [RocksDB](https://github.com/facebook/rocksdb) an embeddable persistent key-value store for fast storage
13//! - `tikv`: [TiKV](https://github.com/tikv/tikv) a distributed, and transactional key-value database
14//! - `mem`: in-memory database
15
16pub mod export;
17
18mod api;
19mod batch;
20mod cf;
21mod clock;
22mod ds;
23mod key;
24mod live;
25mod node;
26mod scanner;
27mod stash;
28mod threadpool;
29mod tr;
30mod tx;
31mod version;
32
33mod fdb;
34mod indxdb;
35mod mem;
36mod rocksdb;
37mod surrealcs;
38mod surrealkv;
39mod tikv;
40
41pub(crate) mod cache;
42
43#[cfg(not(target_family = "wasm"))]
44mod index;
45#[cfg(any(
46 feature = "kv-tikv",
47 feature = "kv-fdb",
48 feature = "kv-indxdb",
49 feature = "kv-surrealcs",
50))]
51mod savepoint;
52#[cfg(test)]
53mod tests;
54mod util;
55
56pub(crate) use key::impl_key;
57pub use key::{KeyDecode, KeyDecodeOwned, KeyEncode};
58
59pub use ds::Datastore;
60pub use live::Live;
61pub use tr::{Check, LockType, TransactionType, Transactor};
62pub use tx::Transaction;
63
64#[cfg(not(target_family = "wasm"))]
65pub(crate) use index::{ConsumeResult, IndexBuilder};
66
67/// The key part of a key-value pair. An alias for [`Vec<u8>`].
68pub type Key = Vec<u8>;
69
70/// The value part of a key-value pair. An alias for [`Vec<u8>`].
71pub type Val = Vec<u8>;
72
73/// The Version part of a key-value pair. An alias for [`u64`].
74pub type Version = u64;