A simple embedded key-value store written in rust as a learning project!
To install, simply add kagi
to your Cargo.toml
, for example
[dependencies]
kagi = "0.1.1"
Open a store and store a value to it.
use kagi::open;
fn main() {
// open db
let mut data = open("./test.kg");
// insert value
data.insert("test", vec!["value".to_string]);
// try load
let result = data.get("test");
dbg!(result)
// sync to db
data.save()
}
To further learn how to use kagi, take a look at the examples.
When opening a file, kagi will create it if it doesn't exist, and it will sync to file every 500ms by default.