One Key One File Database https://crates.io/crates/okofdb
https://github.com/Voultapher/okofdb.git
okofdb is a key value database.
Above an implementation defined value size threshold it will use snap to compress the value.
use std::path::Path;
use okofdb::okof;
fn main() -> Result<(), okof::Error> {
let path = Path::new("db-dir");
let key = "plants";
let value = b"Cucumber:Fluxroot";
okof::write(&path, &key, value)?;
assert_eq!(okof::read(&path, &key)?, value);
let other_value = String::from("Ironwood");
okof::write(&path, &key, other_value.as_bytes())?;
assert_eq!(okof::read(&path, &key)?, other_value.as_bytes());
okof::delete(&path, &key)?;
match okof::read(&path, &key) {
Err(okof::Error::NotFound) => Ok(()),
_ => { panic!(); },
}
}
Add this crate to your project.
Rust toolchain and cargo.
Note, some filesystems might struggle with a lot of files in a single directory, which will happen if there are many keys.
One key == One File.
cargo test
TBD
Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to us.
We use SemVer for versioning. For the versions available, see the tags on this repository.
Lukas Bergdoll - Initial work* - Voultapher
See also the list of contributors who participated in this project.
This project is licensed under the Apache License, Version 2.0 - see the LICENSE.md file for details.