2 releases
0.0.1-alpha1 | Jan 8, 2025 |
---|---|
0.0.0 | Jan 8, 2025 |
#1198 in Database interfaces
239 downloads per month
9KB
149 lines
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
- Ensure you have Rust installed (https://www.rust-lang.org/)
- Clone this repository
- 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 pairget [key]
- Retrieve a value by keyrm [key]
- Remove a key-value pairexit
- 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.
Dependencies
~0.6–2MB
~40K SLoC