mirror of
https://github.com/launchbadge/sqlx
synced 2024-11-10 14:34:19 +00:00
macros: add support for Postgres + BigDecimal
This commit is contained in:
parent
703dad8fcf
commit
3cb42def3b
2 changed files with 5 additions and 0 deletions
|
@ -62,6 +62,8 @@ impl PgTypeInfo {
|
|||
match self.id {
|
||||
TypeId::DATE | TypeId::TIME | TypeId::TIMESTAMP | TypeId::TIMESTAMPTZ => Some("chrono"),
|
||||
TypeId::UUID => Some("uuid"),
|
||||
// we can support decoding `PgNumeric` but it's decidedly less useful to the layman
|
||||
TypeId::NUMERIC => Some("bigdecimal"),
|
||||
_ => None,
|
||||
}
|
||||
}
|
||||
|
|
|
@ -25,6 +25,9 @@ impl_database_ext! {
|
|||
|
||||
#[cfg(feature = "chrono")]
|
||||
sqlx::types::chrono::DateTime<sqlx::types::chrono::Utc> | sqlx::types::chrono::DateTime<_>,
|
||||
|
||||
#[cfg(feature = "bigdecimal")]
|
||||
sqlx::types::BigDecimal
|
||||
},
|
||||
ParamChecking::Strong,
|
||||
feature-types: info => info.type_feature_gate(),
|
||||
|
|
Loading…
Reference in a new issue