kvstore

Crates.iokvstore
lib.rskvstore
version0.2.1
sourcesrc
created_at2023-12-26 22:08:28.602257
updated_at2024-02-21 18:22:37.434633
descriptionA simple, typesafe key-value store, that allows users to set, get, and delete key-value pairs, with each key stored in a separate file on disk.
homepagehttps://patbeagan.dev
repositoryhttps://github.com/patbeagan1/Open-Source-Requests
max_upload_size
id1081221
size43,455
(patbeagan1)

documentation

README

Rust-Based Key-Value Store Tool

Overview

This tool is a simple yet powerful key-value store, implemented in Rust. It allows users to set, get, and delete key-value pairs, with each key stored in a separate file on disk. Inspired by Android's Shared Preferences, it supports different data types like String, Integer, and Float.

Features

  • Set, Get, Delete Operations: Perform basic key-value operations.
  • Type Checking: Handles different data types, including strings, integers, and floats.
  • File-Based Storage: Each key-value pair is stored in a separate file for persistence.
  • Command-Line Interface: Easy to use with simple command-line arguments.

Installation

From crates.io

cargo install kvstore 

c

From Source

Ensure you have Rust and Cargo installed on your system. Follow these steps to install:

  1. Clone the repository:
    git clone [repository-url]
    
  2. Navigate to the project directory:
    cd my_kv_store
    
  3. Build the project using Cargo:
    cargo build --release
    

Usage

After building the project, you can run the tool using the Cargo run command followed by the operation you want to perform.

Set a generic Key-Value Pair

cargo run -- set <key> <value> [--type <type>]
  • <key>: The key for the value.
  • <value>: The value to store.
  • <type>: The type of the value (String, Integer, Float). Default is String.

Using set will infer a type for the value. If you want to specify the value, you can use one of the following instead:

  • setString
  • setInteger
  • setFloat

Get a Value

cargo run -- get <key>
  • <key>: The key of the value to retrieve.

Using get will return the type as well as the value - something like String:hello. If you want to specify the value, you can use one of the following instead:

  • getString
  • getInteger
  • getFloat

Delete a Key-Value Pair

cargo run -- delete <key>
  • <key>: The key of the value to delete.

Contributing

Contributions to this project are welcome! Feel free to fork the repository and submit pull requests.

License

This project is licensed under The MIT License - see the LICENSE file for details.

Commit count: 0

cargo fmt