owl/examples/blob.rs
JMARyA 6c54873ca2
Some checks failed
ci/woodpecker/push/test Pipeline failed
init
2025-04-28 18:53:21 +02:00

17 lines
420 B
Rust

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}");
}