Crates.io | safe_en |
lib.rs | safe_en |
version | 1.8.0 |
source | src |
created_at | 2022-04-02 17:30:06.756469 |
updated_at | 2022-05-05 21:57:20.217 |
description | Local database solution with clean and strict data integrity. |
homepage | |
repository | https://github.com/behemehal/SafeEn |
max_upload_size | |
id | 560996 |
size | 98,441 |
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")