Skip to content

Commit f316b0d

Browse files
saiintbrissonabonander
authored andcommitted
fix(macros): only enable chrono when time is disabled
1 parent 30db1f8 commit f316b0d

File tree

2 files changed

+19
-19
lines changed

2 files changed

+19
-19
lines changed

sqlx-macros-core/src/database/postgres.rs

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -26,19 +26,19 @@ impl_database_ext! {
2626
#[cfg(feature = "uuid")]
2727
sqlx::types::Uuid,
2828

29-
#[cfg(feature = "chrono")]
29+
#[cfg(all(feature = "chrono", not(feature = "time")))]
3030
sqlx::types::chrono::NaiveTime,
3131

32-
#[cfg(feature = "chrono")]
32+
#[cfg(all(feature = "chrono", not(feature = "time")))]
3333
sqlx::types::chrono::NaiveDate,
3434

35-
#[cfg(feature = "chrono")]
35+
#[cfg(all(feature = "chrono", not(feature = "time")))]
3636
sqlx::types::chrono::NaiveDateTime,
3737

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

sqlx-macros-core/src/database/sqlite.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@ impl_database_ext! {
1212
String,
1313
Vec<u8>,
1414

15-
#[cfg(feature = "chrono")]
15+
#[cfg(all(feature = "chrono", not(feature = "time")))]
1616
sqlx::types::chrono::NaiveDate,
1717

18-
#[cfg(feature = "chrono")]
18+
#[cfg(all(feature = "chrono", not(feature = "time")))]
1919
sqlx::types::chrono::NaiveDateTime,
2020

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

2424
#[cfg(feature = "time")]

0 commit comments

Comments
 (0)