simple_db

Crates.iosimple_db
lib.rssimple_db
version0.1.2
created_at2024-11-29 22:04:52.854469+00
updated_at2025-01-18 18:59:34.155116+00
descriptionrust databasing crate for local file store
homepage
repositoryhttps://github.com/AnasDEV2005/brudb.git
max_upload_size
id1466089
size7,158
(AnasDEV2005)

documentation

README

simpleDB | key value database file store

Checkout colondb crate for multiple column support.

[!NOTE] The simple_db struct is not the database itself, its just a way to apply changes to the .txt where the database is saved


usage

add to Cargo.toml

cargo add simple_db

use in main.rs

use simple_db::SimpleDB;

Methods:

find save file, or create one

let mut database = SimpleDB::find_database("db3.txt");
let mut db = database.unwrap(); // this or handle the error

You have to .to_string() input values. Like so:

database.insert_into_db(key, value); // add key value pair to database

get value by id (key)

database.get_value_from_db(key)

delete value by key

database.delete_from_db(key)

sort the database

db.sort_by_key();
db.sort_by_value();

to edit the data yourself:

db.data... // the data here is an indexmap of string: string

print db

db.print_db()
Commit count: 0

cargo fmt