File tree Expand file tree Collapse file tree 1 file changed +8
-9
lines changed Expand file tree Collapse file tree 1 file changed +8
-9
lines changed Original file line number Diff line number Diff line change @@ -116,17 +116,16 @@ async fn it_has_json() -> anyhow::Result<()> {
116116#[ sqlx_macros:: test]
117117async fn it_has_uuid ( ) -> anyhow:: Result < ( ) > {
118118 use sqlx_oldapi:: types:: Uuid ;
119- #[ cfg( feature = "sqlite" ) ]
120- let sql = "x'123e4567e89b12d3a456426614174000'" ;
121- #[ cfg( feature = "mssql" ) ]
122- let sql = "CONVERT(uniqueidentifier, '123e4567-e89b-12d3-a456-426614174000')" ;
123- #[ cfg( feature = "postgres" ) ]
124- let sql = "CAST('123e4567-e89b-12d3-a456-426614174000' AS UUID)" ;
125- #[ cfg( feature = "mysql" ) ]
126- let sql = "UUID_TO_BIN('123e4567-e89b-12d3-a456-426614174000')" ;
127119 assert_eq ! (
128120 Uuid :: parse_str( "123e4567-e89b-12d3-a456-426614174000" ) ?,
129- get_val:: <Uuid >( sql) . await ?
121+ get_val:: <Uuid >( if cfg!( feature = "mssql" ) {
122+ "CONVERT(uniqueidentifier, '123e4567-e89b-12d3-a456-426614174000')²"
123+ } else if cfg!( feature = "postgres" ) {
124+ "'123e4567-e89b-12d3-a456-426614174000'::uuid"
125+ } else {
126+ "x'123e4567e89b12d3a456426614174000'"
127+ } )
128+ . await ?
130129 ) ;
131130 Ok ( ( ) )
132131}
You can’t perform that action at this time.
0 commit comments