commit
6c54873ca2
34 changed files with 5502 additions and 0 deletions
17
examples/blob.rs
Normal file
17
examples/blob.rs
Normal file
|
@ -0,0 +1,17 @@
|
|||
use owl::{db::model::file::File, prelude::*, Identifiable};
|
||||
|
||||
pub fn main() {
|
||||
// Init
|
||||
let db = Database::in_memory();
|
||||
|
||||
let f = File::new(
|
||||
include_bytes!("../Cargo.toml").to_vec(),
|
||||
Some("Cargo.toml".to_string()),
|
||||
&db,
|
||||
);
|
||||
dbg!(&f);
|
||||
|
||||
let f: Model<File> = db.get(f.id()).unwrap();
|
||||
let data = String::from_utf8(f.read_file(&db)).unwrap();
|
||||
println!("Content: {data}");
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue