post-cortex-storage 0.3.1

Storage backends for post-cortex — lock-free RocksDB (default) and optional SurrealDB. Implements the Storage trait against the post-cortex domain types.
Documentation

post-cortex-storage

Crates.io Docs.rs License: MIT

Storage backends for post-cortex. Provides the [Storage] trait plus the lock-free RocksDB backend ([RealRocksDBStorage]) and an optional SurrealDB backend behind the surrealdb-storage feature.

Install

[dependencies]
post-cortex-storage = "0.2"                                          # RocksDB only
post-cortex-storage = { version = "0.2", features = ["surrealdb-storage"] }  # + SurrealDB

Features

Feature Default What it enables
surrealdb-storage no SurrealDB backend (kv-mem + protocol-ws)
surrealdb-tikv no SurrealDB with TiKV distributed KV
otel no OpenTelemetry instrumentation hooks

The RocksDB backend is always compiled — it's the post-cortex default and what the daemon ships with.

Example

use post_cortex_storage::{RealRocksDBStorage, Storage};
use std::sync::Arc;

# async fn run() -> Result<(), Box<dyn std::error::Error>> {
let storage = Arc::new(RealRocksDBStorage::new("./pcx-data")?);
// `Storage` is `dyn`-compatible — pass `Arc<dyn Storage>` to any consumer.
let session_count = storage.list_sessions().await?.len();
println!("{session_count} sessions persisted");
# Ok(()) }

License

MIT — see LICENSE.