Crates.io | kagi |
lib.rs | kagi |
version | 0.1.1 |
source | src |
created_at | 2022-02-20 03:39:38.233354 |
updated_at | 2022-02-23 13:51:24.361713 |
description | A simple key-value store |
homepage | |
repository | https://github.com/blobcode/kagi |
max_upload_size | |
id | 535532 |
size | 6,373 |
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", "value");
// try load
let result = data.get("test");
println!("{}", 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.