Crates.io | mintkv |
lib.rs | mintkv |
version | 0.1.0 |
source | src |
created_at | 2024-04-18 01:40:27.336469 |
updated_at | 2024-04-18 01:40:27.336469 |
description | A simple kv library based on btree |
homepage | |
repository | |
max_upload_size | |
id | 1212014 |
size | 89,687 |
A simple KV database in rust is based on btree, written as a learning project.
data
|----blocks
| b_0000001
data
meta.json
index.json
tombstone
| b_0000002
data
meta.json
index.json
tombstone
|-----memtables (mmap)
| m_0001
data
tombstone
use mintkv::db::MintKv;
const TEST_COUNT: i32 = 1000;
fn main() {
let mut db = MintKv::new("./data");
for i in 0..TEST_COUNT {
let (key, value) = (format!("key-{}", i), format!("value-{}", i));
db.insert(&key, &value).unwrap();
}
for i in 0..TEST_COUNT {
let key = format!("key-{}", i);
let result = db.get(&key);
println!("Search For: {}, Reesult: {:?}", key, result);
}
}