toasty_driver_integration_suite/scenarios/
document_optional_metadata_deferred_notes.rs1use crate::prelude::*;
2
3scenario! {
4 #![id(ID)]
5
6 #[derive(Debug, toasty::Model)]
7 struct Document {
8 #[key]
9 #[auto]
10 id: ID,
11
12 title: String,
13
14 metadata: Option<Metadata>,
15 }
16
17 #[derive(Debug, toasty::Embed)]
18 struct Metadata {
19 author: String,
20 notes: toasty::Deferred<String>,
21 }
22
23 async fn setup(test: &mut Test) -> toasty::Db {
24 test.setup_db(models!(Document)).await
25 }
26}