Skip to content

Commit

Permalink
Update postgres.rs
Browse files Browse the repository at this point in the history
Support all variants of `NUMERIC` using `decimal` feature like `bigdecimal` does.
  • Loading branch information
tm-drtina committed Apr 3, 2022
1 parent eaf41fd commit b9d48ba
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions sqlx-macros/src/database/postgres.rs
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,9 @@ impl_database_ext! {
#[cfg(feature = "bigdecimal")]
Vec<sqlx::types::BigDecimal> | &[sqlx::types::BigDecimal],

#[cfg(feature = "decimal")]
Vec<sqlx::types::Decimal> | &[sqlx::types::Decimal],

#[cfg(feature = "ipnetwork")]
Vec<sqlx::types::ipnetwork::IpNetwork> | &[sqlx::types::ipnetwork::IpNetwork],

Expand All @@ -134,6 +137,9 @@ impl_database_ext! {
#[cfg(feature = "bigdecimal")]
sqlx::postgres::types::PgRange<sqlx::types::BigDecimal>,

#[cfg(feature = "decimal")]
sqlx::postgres::types::PgRange<sqlx::types::Decimal>,

#[cfg(feature = "chrono")]
sqlx::postgres::types::PgRange<sqlx::types::chrono::NaiveDate>,

Expand Down Expand Up @@ -162,6 +168,10 @@ impl_database_ext! {
Vec<sqlx::postgres::types::PgRange<sqlx::types::BigDecimal>> |
&[sqlx::postgres::types::PgRange<sqlx::types::BigDecimal>],

#[cfg(feature = "decimal")]
Vec<sqlx::postgres::types::PgRange<sqlx::types::Decimal>> |
&[sqlx::postgres::types::PgRange<sqlx::types::Decimal>],

#[cfg(feature = "chrono")]
Vec<sqlx::postgres::types::PgRange<sqlx::types::chrono::NaiveDate>> |
&[sqlx::postgres::types::PgRange<sqlx::types::chrono::NaiveDate>],
Expand Down

0 comments on commit b9d48ba

Please sign in to comment.