Crate quick_kv

source ·
Expand description

QuickKV is a simple key-value database written in Rust Its goal is to allow thread safe access to a database file with minimal overhead It is not meant to be a replacement for a full fledged database, but rather a simple way to store data.

Features

  • Thread safe
  • Simplistic API
  • Minimal overhead
  • Supports any type that implements Serialize and Deserialize from the serde crate

Supported Crud Operations

  • Set
  • Get
  • Update
  • Delete

Installation

cargo add quick-kv

Why use QuickKV?

QuickKV is meant to be used in situations where you need to store data, but don’t want to deal with the overhead of a full fledged database. It is also useful for storing data that doesn’t need to be accessed very often, but still needs to be stored. QuickKV also has the benefit of storing data in a file as binary making it faster than other file formats for data storage.

Examples

use quick_kv::{QuickClient, Value};

 let mut client = QuickClient::new(None).unwrap();

 client
    .set("hello", Value::String("hello world!".to_string()))
    .unwrap();

 let result = match client.get::<Value>("hello").unwrap().unwrap() {
    Value::String(s) => s,
    _ => panic!("Error getting value"),
 };

 assert_eq!(result, String::from("hello world!"));

Structs

  • The data structure used to store key-value pairs in the database
  • The client for the QuickKV database

Enums

  • Represents a value that can be stored in the database.