mirror of
https://github.com/launchbadge/sqlx.git
synced 2025-11-03 15:02:50 +00:00
macros: add support for Postgres + BigDecimal
This commit is contained in:
parent
703dad8fcf
commit
3cb42def3b
@ -62,6 +62,8 @@ impl PgTypeInfo {
|
|||||||
match self.id {
|
match self.id {
|
||||||
TypeId::DATE | TypeId::TIME | TypeId::TIMESTAMP | TypeId::TIMESTAMPTZ => Some("chrono"),
|
TypeId::DATE | TypeId::TIME | TypeId::TIMESTAMP | TypeId::TIMESTAMPTZ => Some("chrono"),
|
||||||
TypeId::UUID => Some("uuid"),
|
TypeId::UUID => Some("uuid"),
|
||||||
|
// we can support decoding `PgNumeric` but it's decidedly less useful to the layman
|
||||||
|
TypeId::NUMERIC => Some("bigdecimal"),
|
||||||
_ => None,
|
_ => None,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -25,6 +25,9 @@ impl_database_ext! {
|
|||||||
|
|
||||||
#[cfg(feature = "chrono")]
|
#[cfg(feature = "chrono")]
|
||||||
sqlx::types::chrono::DateTime<sqlx::types::chrono::Utc> | sqlx::types::chrono::DateTime<_>,
|
sqlx::types::chrono::DateTime<sqlx::types::chrono::Utc> | sqlx::types::chrono::DateTime<_>,
|
||||||
|
|
||||||
|
#[cfg(feature = "bigdecimal")]
|
||||||
|
sqlx::types::BigDecimal
|
||||||
},
|
},
|
||||||
ParamChecking::Strong,
|
ParamChecking::Strong,
|
||||||
feature-types: info => info.type_feature_gate(),
|
feature-types: info => info.type_feature_gate(),
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user