https://github.com/auracletech/ahri
ahri is a database ๐ณ
https://github.com/auracletech/ahri
Last synced: 7 months ago
JSON representation
ahri is a database ๐ณ
- Host: GitHub
- URL: https://github.com/auracletech/ahri
- Owner: AuracleTech
- Created: 2023-09-27T18:45:12.000Z (almost 3 years ago)
- Default Branch: master
- Last Pushed: 2023-11-28T21:43:12.000Z (over 2 years ago)
- Last Synced: 2025-01-29T09:16:59.286Z (over 1 year ago)
- Language: Rust
- Homepage:
- Size: 59.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOD.md
Awesome Lists containing this project
README
# ahri
ahri is a database ๐ณ
##### Completed
- [x] Database structure
- [ ] Async support
- [x] Serialization / Deserialization
- [ ] ACID transactions
##### Example
```rust
use ahri::Table;
use serde::{Deserialize, Serialize};
#[derive(Serialize, Deserialize, Debug)]
struct Book {
name: String,
year: u16,
}
fn main() -> Result<(), Box> {
let default_book = Book {
name: "Unknown Book".to_string(),
year: 0,
};
let mut bookshelf = Table::from_structure(default_book);
for i in 0..7 {
let book_name = format!("Harry Potter {}", i + 1);
let new_book = Book {
name: book_name.clone(),
year: 1997 + i as u16,
};
bookshelf.insert(&book_name, new_book);
}
println!("Bookshelf: {:#?}", bookshelf);
Ok(())
}
```
##### Result
```rust,ignore
Bookshelf: Table {
default: Book {
name: "Unknown Book",
year: 0,
},
rows: {
"Harry Potter 3": Book {
name: "Harry Potter 3",
year: 1999,
},
"Harry Potter 6": Book {
name: "Harry Potter 6",
year: 2002,
},
"Harry Potter 7": Book {
name: "Harry Potter 7",
year: 2003,
},
"Harry Potter 2": Book {
name: "Harry Potter 2",
year: 1998,
},
"Harry Potter 4": Book {
name: "Harry Potter 4",
year: 2000,
},
"Harry Potter 5": Book {
name: "Harry Potter 5",
year: 2001,
},
"Harry Potter 1": Book {
name: "Harry Potter 1",
year: 1997,
},
},
}
```
##### Performances
creation of 4 tables and for each inserting 1000 entries in `766 ยตs`