Skip to content

Latest commit

 

History

History
31 lines (22 loc) · 544 Bytes

README.md

File metadata and controls

31 lines (22 loc) · 544 Bytes

A Fast Key-Value Database based on BitCask written by Rust

Features

  • CRUD
  • Key Expire
  • Write Batch
  • Simple MVCC transaction
  • Backup

Basic Usage

use std::error::Error;

use bitcask_rs_core::{config::Config, db::Engine};

fn main() -> Result<(), Box<dyn Error>> {
    let db = Engine::open(Config {
        db_path: "/tmp/bitcask/".into(),
        ..Default::default()
    })?;

    db.put("foo", "bar")?;

    println!("{}", String::from_utf8(db.get("111")?)?);

    db.del("foo")?;

    Ok(())
}