colon_db 0.1.0

file data base with multiple columns and an id column
Documentation
  • Coverage
  • 0%
    0 out of 13 items documented0 out of 12 items with examples
  • Size
  • Source code size: 14.01 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 367.42 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 8s Average build duration of successful builds.
  • all releases: 14s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Homepage
  • AnasDEV2005/brudb
    2 1 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • AnasDEV2005
colon_db-0.1.0 has been yanked.

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.

[package]
name = "libtest"
version = "0.1.0"
edition = "2021"

[dependencies]
colon_db = { path = "../../colondb" }
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();