colon_db

Crates.iocolon_db
lib.rscolon_db
version0.1.2
created_at2024-11-29 22:02:54.034641+00
updated_at2025-01-18 19:01:09.448632+00
descriptionrust databasing key value storing with multiple columns crate
homepage
repositoryhttps://github.com/AnasDEV2005/brudb.git
max_upload_size
id1466087
size15,521
(AnasDEV2005)

documentation

README

colonDB | simpleDB with multiple columns support (database file store)

Checkout main folder for simple key value store. Make sure you clone this repo inside the directory you write in the cargo.toml's [dependencies] simple_db = ... May still contain issues, havent tested enough.


usage

I suggest typing in the first row, which will be used as headers to find stuff based on column headers, in the .txt file before dealing with data.

add to Cargo.toml
(edit the path as suits you)

cargo add colon_db

use in main.rs

use colon_db::ColonDB;

Methods:

find save file, or create one

let mut database = ColonDB::find_database("db.txt");

Make sure to .to_string() input values. Check example.

add item or row

database.append_row_to_db("23".to_string(),vec!["a".to_string(),"12".to_string(),"3000".to_string()]);

database.insert_item_into_db("21".to_string(),"name".to_string(), "kak".to_string());
database.insert_item_into_db("21".to_string(),"age".to_string(), "18".to_string());

append a column

db.append_column("status".to_string(), "citizen".to_string());

select a range from the db (0 to total number of rows, vector with column names)

let newdb = database.select_data(Some(4..17), vec!["name".to_string(), "salary".to_string()].into());

get item by key, column

println!("{}",database.select_item("01", "age").unwrap())

delete a row

database.delete_row("09");

display database in terminal

newdb.print_database();
Commit count: 0

cargo fmt