safe_en

Crates.iosafe_en
lib.rssafe_en
version1.8.0
sourcesrc
created_at2022-04-02 17:30:06.756469
updated_at2022-05-05 21:57:20.217
descriptionLocal database solution with clean and strict data integrity.
homepage
repositoryhttps://github.com/behemehal/SafeEn
max_upload_size
id560996
size98,441
Ahmetcan Aksu (ahmtcn123)

documentation

https://docs.rs/safe_en

README

SafeEn

Crates.io Version Documentation

Local database solution for sit

Local database solution for situations that requires strict data integrity and absolute portability

use safe_en::{
    table::{TableRow, TypeDefs},
    Database,
};

let mut db = Database::new();

db.set_name("users".to_string());

db.create_table(
    "users",
    vec![
        TableRow::new("id", TypeDefs::I64),
        TableRow::new("email", TypeDefs::String),
    ],
).unwrap();


let id = 1_i64;;
let email = "ahmet@mail.com";

db.table("users").unwrap().insert(vec![id.into(), email.into()]).unwrap();

let list_entries = table.get_where(|x| x.row("email").is("ahmet@mail.com"));

for entry in list_entries {
    println!("{}", entry);
}

db.save("./examples/db.sfn")
Commit count: 32

cargo fmt