17 lines
420 B
Rust
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}");
|
|
}
|