colon_db

Crates.iocolon_db
lib.rscolon_db
version0.1.1
sourcesrc
created_at2024-11-29 22:02:54.034641
updated_at2024-11-29 22:20:55.143008
descriptionfile data base with multiple columns and an id column
homepagehttps://github.com/AnasDEV2005/brudb
repositoryhttps://github.com/AnasDEV2005/brudb
max_upload_size
id1466087
size13,208
(AnasDEV2005)

documentation

README

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

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.insert_item_into_db("01".to_string(),"age".to_string(), "18".to_string());
database.insert_item_into_db("01".to_string(),"salary".to_string(), "0".to_string());

database.insert_row_into_db("02".to_string(),vec!["alan".to_string(),"12".to_string(),"23".to_string()]);

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

let newdb = database.select_data(Some(0..4), vec!["name".to_string(),"age".to_string()].into());
// None on either selects all available range

get item by key, column

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

delete item, row, column

database.delete_column("salary".to_string());
database.delete_item("08", "name".to_string());
database.delete_row("09");

display database in terminal

newdb.print_database();

access database (note: its an indexmap)

database.data // ... whatever action
Commit count: 16

cargo fmt