Don't test custom records until we have some kind of fixtures

This commit is contained in:
Ryan Leckey 2020-03-17 19:42:23 -07:00
parent ff722d0e62
commit fb5db48c52

View File

@ -28,14 +28,15 @@ enum Strong {
Three, Three,
} }
// TODO: Figure out a good solution for custom type testing
// Records must map to a custom type // Records must map to a custom type
// Note that all types are types in Postgres // Note that all types are types in Postgres
#[derive(PartialEq, Debug, sqlx::Type)] // #[derive(PartialEq, Debug, sqlx::Type)]
#[sqlx(postgres(oid = 12184))] // #[sqlx(postgres(oid = 12184))]
struct PgConfig { // struct PgConfig {
name: String, // name: String,
setting: Option<String>, // setting: Option<String>,
} // }
test_type!(transparent( test_type!(transparent(
Postgres, Postgres,
@ -60,25 +61,26 @@ test_type!(strong_enum(
"'four'::text" == Strong::Three "'four'::text" == Strong::Three
)); ));
test_type!(record_pg_config( // TODO: Figure out a good solution for custom type testing
Postgres, // test_type!(record_pg_config(
PgConfig, // Postgres,
// (CC,gcc) // PgConfig,
"(SELECT ROW('CC', 'gcc')::pg_config)" // // (CC,gcc)
== PgConfig { // "(SELECT ROW('CC', 'gcc')::pg_config)"
name: "CC".to_owned(), // == PgConfig {
setting: Some("gcc".to_owned()), // name: "CC".to_owned(),
}, // setting: Some("gcc".to_owned()),
// (CC,) // },
"(SELECT '(\"CC\",)'::pg_config)" // // (CC,)
== PgConfig { // "(SELECT '(\"CC\",)'::pg_config)"
name: "CC".to_owned(), // == PgConfig {
setting: None, // name: "CC".to_owned(),
}, // setting: None,
// (CC,"") // },
"(SELECT '(\"CC\",\"\")'::pg_config)" // // (CC,"")
== PgConfig { // "(SELECT '(\"CC\",\"\")'::pg_config)"
name: "CC".to_owned(), // == PgConfig {
setting: Some("".to_owned()), // name: "CC".to_owned(),
} // setting: Some("".to_owned()),
)); // }
// ));