| Crates.io | aingle-lmdb-sys |
| lib.rs | aingle-lmdb-sys |
| version | 0.1.0 |
| created_at | 2025-12-17 07:53:58.397602+00 |
| updated_at | 2025-12-17 07:53:58.397602+00 |
| description | Rust FFI bindings for LMDB - optimized for AIngle |
| homepage | https://apilium.com |
| repository | https://github.com/ApiliumCode/lmdb-rs |
| max_upload_size | |
| id | 1989518 |
| size | 755,238 |
Rust bindings for LMDB - optimized for AIngle
Idiomatic and safe Rust APIs for interacting with the Symas Lightning Memory-Mapped Database (LMDB). This fork is optimized for use within the AIngle distributed systems framework.
[dependencies]
lmdb-rkv = "0.1"
use lmdb::{Environment, Database, WriteFlags};
use std::path::Path;
fn main() -> Result<(), Box<dyn std::error::Error>> {
// Open environment
let env = Environment::new()
.set_max_dbs(1)
.open(Path::new("./data"))?;
// Open database
let db = env.open_db(None)?;
// Write transaction
{
let mut txn = env.begin_rw_txn()?;
txn.put(db, b"key", b"value", WriteFlags::empty())?;
txn.commit()?;
}
// Read transaction
{
let txn = env.begin_ro_txn()?;
let value = txn.get(db, b"key")?;
println!("Value: {:?}", String::from_utf8_lossy(value));
}
Ok(())
}
| Crate | Description |
|---|---|
lmdb-rkv |
High-level Rust API |
lmdb-rkv-sys |
Low-level FFI bindings |
# Clone with submodules
git clone --recursive https://github.com/ApiliumCode/lmdb-rs-apilium.git
cd lmdb-rs-apilium
# Build
cargo build
# Run tests
cargo test
LMDB provides exceptional read performance through memory-mapped files:
| Operation | Performance |
|---|---|
| Read | O(1) - Direct memory access |
| Write | O(log n) - B+ tree insertion |
| Iteration | Sequential disk access |
This crate is part of the AIngle ecosystem - a Semantic DAG framework for IoT and distributed AI applications.
Licensed under the Apache License, Version 2.0. See LICENSE for details.
Maintained by Apilium Technologies - Tallinn, Estonia