From b989b366c2c2c41cf423000f8aca481cefae17bd Mon Sep 17 00:00:00 2001 From: Austin Bonander Date: Mon, 31 Mar 2025 03:09:47 -0700 Subject: [PATCH] fix: deprecation warning in `tests/postgres/macros.rs` --- sqlx-core/src/type_checking.rs | 4 ++-- tests/postgres/macros.rs | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/sqlx-core/src/type_checking.rs b/sqlx-core/src/type_checking.rs index 9e9ddb6ac..f10dc79dc 100644 --- a/sqlx-core/src/type_checking.rs +++ b/sqlx-core/src/type_checking.rs @@ -413,7 +413,7 @@ macro_rules! impl_type_checking { $( if <$bigdecimal_ty as sqlx_core::types::Type<$database>>::type_info() == *info { if cfg!(feature = "rust_decimal") { - return Err($crate::type_checking::Error::AmbiguousDateTimeType { + return Err($crate::type_checking::Error::AmbiguousNumericType { fallback: stringify!($bigdecimal_ty), }); } @@ -425,7 +425,7 @@ macro_rules! impl_type_checking { $( if <$bigdecimal_ty as sqlx_core::types::Type<$database>>::compatible(info) { if cfg!(feature = "rust_decimal") { - return Err($crate::type_checking::Error::AmbiguousDateTimeType { + return Err($crate::type_checking::Error::AmbiguousNumericType { fallback: stringify!($bigdecimal_ty), }); } diff --git a/tests/postgres/macros.rs b/tests/postgres/macros.rs index 07ae96201..04c1fe9d1 100644 --- a/tests/postgres/macros.rs +++ b/tests/postgres/macros.rs @@ -295,6 +295,7 @@ async fn query_by_bigdecimal() -> anyhow::Result<()> { let decimal = "1234".parse::()?; let ref tuple = ("51245.121232".parse::()?,); + #[cfg_attr(feature = "rust_decimal", allow(deprecated))] // TODO: upgrade to `expect` let result = sqlx::query!( "SELECT * from (VALUES(1234.0)) decimals(decimal)\ where decimal in ($1, $2, $3, $4, $5, $6, $7)",