crystal

Crates.iocrystal
lib.rscrystal
version0.0.1-alpha1
created_at2025-01-08 09:35:33.134092+00
updated_at2025-01-08 09:37:43.921615+00
descriptionCrystal, a simple database.
homepage
repository
max_upload_size
id1508352
size19,271
(Da1sypetals)

documentation

README

Crystal - A Simple Key-Value Store

Crystal is a simple, persistent key-value store implemented in Rust with a REPL interface.

Features

  • Persistent key-value storage
  • Simple CRUD operations
  • REPL interface for interactive use
  • Binary serialization using bincode
  • Command history persistence

Installation

  1. Ensure you have Rust installed (https://www.rust-lang.org/)
  2. Clone this repository
  3. Build the project:
    cargo build --release
    

Usage

Start the REPL:

cargo run --features repl

Example Session

crystal> set name Alice
crystal> get name
Alice
crystal> rm name
crystal> get name
Key not found
crystal> exit

Commands

  • set [key] [value] - Store a key-value pair
  • get [key] - Retrieve a value by key
  • rm [key] - Remove a key-value pair
  • exit - Exit the REPL

Data Storage

Data is stored in binary format in the ./data directory. Command history is stored in history.txt.

License

Apache 2.0 - See LICENSE for details.

Commit count: 0

cargo fmt