@@ -32,10 +32,11 @@ enum Strong {
32
32
// Records must map to a custom type
33
33
// Note that all types are types in Postgres
34
34
// #[derive(PartialEq, Debug, sqlx::Type)]
35
- // #[sqlx(postgres(oid = 12184 ))]
36
- // struct PgConfig {
35
+ // #[sqlx(postgres(oid = ? ))]
36
+ // struct InventoryItem {
37
37
// name: String,
38
- // setting: Option<String>,
38
+ // supplier_id: Option<i32>,
39
+ // price: Option<i64>
39
40
// }
40
41
41
42
test_type ! ( transparent(
@@ -64,23 +65,23 @@ test_type!(strong_enum(
64
65
// TODO: Figure out a good solution for custom type testing
65
66
// test_type!(record_pg_config(
66
67
// Postgres,
67
- // PgConfig ,
68
- // // (CC,gcc)
69
- // "(SELECT ROW('CC', 'gcc')::pg_config)"
70
- // == PgConfig {
71
- // name: "CC".to_owned( ),
72
- // setting : Some("gcc".to_owned() ),
68
+ // InventoryItem ,
69
+ // "(SELECT ROW('fuzzy dice', 42, 199)::inventory_item)"
70
+ // == InventoryItem {
71
+ // name: "fuzzy dice".to_owned(),
72
+ // supplier_id: Some(42 ),
73
+ // price : Some(199 ),
73
74
// },
74
- // // (CC,)
75
- // "(SELECT '(\"CC\",)'::pg_config)"
76
- // == PgConfig {
77
- // name: "CC".to_owned() ,
78
- // setting : None,
75
+ // "(SELECT '(\"fuuzy dice\",,)'::pg_config)"
76
+ // == InventoryItem {
77
+ // name: "fuzzy dice".to_owned(),
78
+ // supplier_id: None ,
79
+ // price : None,
79
80
// },
80
- // // (CC,"")
81
- // "(SELECT '(\"CC\",\"\")'::pg_config)"
82
- // == PgConfig {
83
- // name: "CC".to_owned() ,
84
- // setting : Some("".to_owned()),
81
+ // "(SELECT '(\"\",,2350)'::pg_config)"
82
+ // == InventoryItem {
83
+ // name: "".to_owned(),
84
+ // supplier_id: None ,
85
+ // price : Some(2350)
85
86
// }
86
87
// ));
0 commit comments