Skip to content

Commit b989b36

Browse files
committed
fix: deprecation warning in tests/postgres/macros.rs
1 parent 80abc5b commit b989b36

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

sqlx-core/src/type_checking.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -413,7 +413,7 @@ macro_rules! impl_type_checking {
413413
$(
414414
if <$bigdecimal_ty as sqlx_core::types::Type<$database>>::type_info() == *info {
415415
if cfg!(feature = "rust_decimal") {
416-
return Err($crate::type_checking::Error::AmbiguousDateTimeType {
416+
return Err($crate::type_checking::Error::AmbiguousNumericType {
417417
fallback: stringify!($bigdecimal_ty),
418418
});
419419
}
@@ -425,7 +425,7 @@ macro_rules! impl_type_checking {
425425
$(
426426
if <$bigdecimal_ty as sqlx_core::types::Type<$database>>::compatible(info) {
427427
if cfg!(feature = "rust_decimal") {
428-
return Err($crate::type_checking::Error::AmbiguousDateTimeType {
428+
return Err($crate::type_checking::Error::AmbiguousNumericType {
429429
fallback: stringify!($bigdecimal_ty),
430430
});
431431
}

tests/postgres/macros.rs

+1
Original file line numberDiff line numberDiff line change
@@ -295,6 +295,7 @@ async fn query_by_bigdecimal() -> anyhow::Result<()> {
295295
let decimal = "1234".parse::<BigDecimal>()?;
296296
let ref tuple = ("51245.121232".parse::<BigDecimal>()?,);
297297

298+
#[cfg_attr(feature = "rust_decimal", allow(deprecated))] // TODO: upgrade to `expect`
298299
let result = sqlx::query!(
299300
"SELECT * from (VALUES(1234.0)) decimals(decimal)\
300301
where decimal in ($1, $2, $3, $4, $5, $6, $7)",

0 commit comments

Comments
 (0)