mirror of
https://github.com/launchbadge/sqlx.git
synced 2026-03-09 23:30:03 +00:00
fix: deprecation warning in tests/postgres/macros.rs
This commit is contained in:
parent
80abc5b166
commit
b989b366c2
@ -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),
|
||||
});
|
||||
}
|
||||
|
||||
@ -295,6 +295,7 @@ async fn query_by_bigdecimal() -> anyhow::Result<()> {
|
||||
let decimal = "1234".parse::<BigDecimal>()?;
|
||||
let ref tuple = ("51245.121232".parse::<BigDecimal>()?,);
|
||||
|
||||
#[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)",
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user