Skip to main content

toasty_driver_integration_suite/scenarios/
in_list_item.rs

1//! Single `Item` model with one of each filterable type the `IN`-list tests
2//! exercise: a String column (`name`), a numeric column (`n`), an Option
3//! column (`bio`), and the auto-generated `id` (whose concrete type varies
4//! by ID variant — `u64` or `uuid::Uuid`).
5
6use crate::prelude::*;
7
8scenario! {
9    #[derive(Debug, toasty::Model)]
10    struct Item {
11        #[key]
12        #[auto]
13        id: uuid::Uuid,
14
15        #[index]
16        name: String,
17
18        #[index]
19        n: i64,
20
21        bio: Option<String>,
22    }
23
24    async fn setup(test: &mut Test) -> toasty::Db {
25        test.setup_db(models!(Item)).await
26    }
27}