async-rocksdb
An ergonomic, async wrapper for RocksDB in Rust.
Features
- Fully async operations
- Column families with custom options
- Consistent snapshots
- High-performance prefix scans
- Batch reads/deletes (
multi_get,multi_delete) - Manual flush and compaction
Example
use AsyncRocksBuilder;
async
## Column Families
```rust
let db = new
.add_column_family
.add_column_family
.open
.await?;
db.put.await?;
let val = db.get.await?;
## Snapshots
Snapshots are best-effort consistent in async context due to spawn_blocking scheduling.
```rust
let snapshot = db.snapshot;
db.put.await?;
// Latest read sees "new"
assert_eq!;
// Snapshot read sees old value (or latest in async context)
let old = db.get.await?;
## Prefix Scans
```rust
db.put.await?;
db.put.await?;
db.put.await?;
let users = db.prefix_all.await?;
assert_eq!;
## Batch Operations
```rust
let keys = vec!;
let values = db.multi_get.await?;
let _ = db.multi_delete.await?;
## Why async-rocksdb?
The official crate for rocksdb is perfect but sync only.
In async apps, calls are wrapped in spawn_blocking.
And this crate does that with a clean API AND extra features like prefix scans and snapshots.