SurrealDB with RocksDB backend in Rust embedded client with local database storage



examples/surrealdb/embedded-rocksdb/Cargo.toml
[package]
name = "embedded-rocksdb"
version = "0.1.0"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
serde = { version = "1.0", features = ["derive"] }
surrealdb = { version = "2.0", features = ["kv-rocksdb"] }
tokio = { version = "1.35", features = ["macros", "rt-multi-thread"] }

examples/surrealdb/embedded-rocksdb/src/main.rs
use surrealdb::engine::local::RocksDb;
use surrealdb::Surreal;

#[tokio::main]
async fn main() -> surrealdb::Result<()> {
    let db = Surreal::new::<RocksDb>("tempdb").await?;

    db.use_ns("namespace").use_db("database").await?;

    Ok(())
}