| Crates.io | simple_db |
| lib.rs | simple_db |
| version | 0.1.2 |
| created_at | 2024-11-29 22:04:52.854469+00 |
| updated_at | 2025-01-18 18:59:34.155116+00 |
| description | rust databasing crate for local file store |
| homepage | |
| repository | https://github.com/AnasDEV2005/brudb.git |
| max_upload_size | |
| id | 1466089 |
| size | 7,158 |
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
add to Cargo.toml
cargo add simple_db
use in main.rs
use simple_db::SimpleDB;
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()