Skip to content

Commit

Permalink
fix(macros): only enable chrono when time is disabled
Browse files Browse the repository at this point in the history
  • Loading branch information
saiintbrisson authored and abonander committed Mar 12, 2024
1 parent 30db1f8 commit f316b0d
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 19 deletions.
32 changes: 16 additions & 16 deletions sqlx-macros-core/src/database/postgres.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,19 +26,19 @@ impl_database_ext! {
#[cfg(feature = "uuid")]
sqlx::types::Uuid,

#[cfg(feature = "chrono")]
#[cfg(all(feature = "chrono", not(feature = "time")))]
sqlx::types::chrono::NaiveTime,

#[cfg(feature = "chrono")]
#[cfg(all(feature = "chrono", not(feature = "time")))]
sqlx::types::chrono::NaiveDate,

#[cfg(feature = "chrono")]
#[cfg(all(feature = "chrono", not(feature = "time")))]
sqlx::types::chrono::NaiveDateTime,

#[cfg(feature = "chrono")]
#[cfg(all(feature = "chrono", not(feature = "time")))]
sqlx::types::chrono::DateTime<sqlx::types::chrono::Utc> | sqlx::types::chrono::DateTime<_>,

#[cfg(feature = "chrono")]
#[cfg(all(feature = "chrono", not(feature = "time")))]
sqlx::postgres::types::PgTimeTz<sqlx::types::chrono::NaiveTime, sqlx::types::chrono::FixedOffset>,

#[cfg(feature = "time")]
Expand Down Expand Up @@ -91,16 +91,16 @@ impl_database_ext! {
#[cfg(feature = "uuid")]
Vec<sqlx::types::Uuid> | &[sqlx::types::Uuid],

#[cfg(feature = "chrono")]
#[cfg(all(feature = "chrono", not(feature = "time")))]
Vec<sqlx::types::chrono::NaiveTime> | &[sqlx::types::chrono::NaiveTime],

#[cfg(feature = "chrono")]
#[cfg(all(feature = "chrono", not(feature = "time")))]
Vec<sqlx::types::chrono::NaiveDate> | &[sqlx::types::chrono::NaiveDate],

#[cfg(feature = "chrono")]
#[cfg(all(feature = "chrono", not(feature = "time")))]
Vec<sqlx::types::chrono::NaiveDateTime> | &[sqlx::types::chrono::NaiveDateTime],

#[cfg(feature = "chrono")]
#[cfg(all(feature = "chrono", not(feature = "time")))]
Vec<sqlx::types::chrono::DateTime<sqlx::types::chrono::Utc>> | &[sqlx::types::chrono::DateTime<_>],

#[cfg(feature = "time")]
Expand Down Expand Up @@ -141,13 +141,13 @@ impl_database_ext! {
#[cfg(feature = "rust_decimal")]
sqlx::postgres::types::PgRange<sqlx::types::Decimal>,

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

#[cfg(feature = "chrono")]
#[cfg(all(feature = "chrono", not(feature = "time")))]
sqlx::postgres::types::PgRange<sqlx::types::chrono::NaiveDateTime>,

#[cfg(feature = "chrono")]
#[cfg(all(feature = "chrono", not(feature = "time")))]
sqlx::postgres::types::PgRange<sqlx::types::chrono::DateTime<sqlx::types::chrono::Utc>> |
sqlx::postgres::types::PgRange<sqlx::types::chrono::DateTime<_>>,

Expand All @@ -173,19 +173,19 @@ impl_database_ext! {
Vec<sqlx::postgres::types::PgRange<sqlx::types::Decimal>> |
&[sqlx::postgres::types::PgRange<sqlx::types::Decimal>],

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

#[cfg(feature = "chrono")]
#[cfg(all(feature = "chrono", not(feature = "time")))]
Vec<sqlx::postgres::types::PgRange<sqlx::types::chrono::NaiveDateTime>> |
&[sqlx::postgres::types::PgRange<sqlx::types::chrono::NaiveDateTime>],

#[cfg(feature = "chrono")]
#[cfg(all(feature = "chrono", not(feature = "time")))]
Vec<sqlx::postgres::types::PgRange<sqlx::types::chrono::DateTime<sqlx::types::chrono::Utc>>> |
Vec<sqlx::postgres::types::PgRange<sqlx::types::chrono::DateTime<_>>>,

#[cfg(feature = "chrono")]
#[cfg(all(feature = "chrono", not(feature = "time")))]
&[sqlx::postgres::types::PgRange<sqlx::types::chrono::DateTime<sqlx::types::chrono::Utc>>] |
&[sqlx::postgres::types::PgRange<sqlx::types::chrono::DateTime<_>>],

Expand Down
6 changes: 3 additions & 3 deletions sqlx-macros-core/src/database/sqlite.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ impl_database_ext! {
String,
Vec<u8>,

#[cfg(feature = "chrono")]
#[cfg(all(feature = "chrono", not(feature = "time")))]
sqlx::types::chrono::NaiveDate,

#[cfg(feature = "chrono")]
#[cfg(all(feature = "chrono", not(feature = "time")))]
sqlx::types::chrono::NaiveDateTime,

#[cfg(feature = "chrono")]
#[cfg(all(feature = "chrono", not(feature = "time")))]
sqlx::types::chrono::DateTime<sqlx::types::chrono::Utc> | sqlx::types::chrono::DateTime<_>,

#[cfg(feature = "time")]
Expand Down

0 comments on commit f316b0d

Please sign in to comment.