Skip to main content

toasty_driver_integration_suite/scenarios/
document_metadata_deferred_notes.rs

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