https://github.com/behemehal/safeen
Local database solution with clean and strict data integrity.
https://github.com/behemehal/safeen
database local-database localdb localstorage rust
Last synced: about 1 month ago
JSON representation
Local database solution with clean and strict data integrity.
- Host: GitHub
- URL: https://github.com/behemehal/safeen
- Owner: behemehal
- License: gpl-2.0
- Created: 2022-03-14T23:24:11.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2022-05-05T21:57:13.000Z (about 4 years ago)
- Last Synced: 2025-02-06T20:05:03.513Z (over 1 year ago)
- Topics: database, local-database, localdb, localstorage, rust
- Language: Rust
- Homepage: https://crates.io/crates/safe_en
- Size: 273 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# SafeEn
[](https://crates.io/crates/safe_en)
[](https://docs.rs/safe_en)
Local database solution for sit
Local database solution for situations that requires strict data integrity and absolute portability
```rust
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")
```