From 4b254ea1cbe28249a496024a5006a7660eee6caf Mon Sep 17 00:00:00 2001 From: Elliot Speck <11192354+Arcayr@users.noreply.github.com> Date: Sat, 1 Jul 2023 07:56:32 +1000 Subject: [PATCH] sqlite date macro support (#2491) * sqlx-macros-core: Add handling of the 'DATE' pseudo-type in in the sqlite library. Presently this only functions for the `time` feature, because I don't use the `chrono` feature. * Update sqlite.rs Add chrono date support. * Update sqlite.rs rustfmt * Update sqlite.rs Switch order of time::OffsetDateTime and time::PrimitiveDateTime. --- sqlx-macros-core/src/database/sqlite.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/sqlx-macros-core/src/database/sqlite.rs b/sqlx-macros-core/src/database/sqlite.rs index a2ae664f68..3c4c440219 100644 --- a/sqlx-macros-core/src/database/sqlite.rs +++ b/sqlx-macros-core/src/database/sqlite.rs @@ -12,17 +12,23 @@ impl_database_ext! { String, Vec, + #[cfg(feature = "chrono")] + sqlx::types::chrono::NaiveDate, + #[cfg(feature = "chrono")] sqlx::types::chrono::NaiveDateTime, #[cfg(feature = "chrono")] sqlx::types::chrono::DateTime | sqlx::types::chrono::DateTime<_>, + #[cfg(feature = "time")] + sqlx::types::time::OffsetDateTime, + #[cfg(feature = "time")] sqlx::types::time::PrimitiveDateTime, #[cfg(feature = "time")] - sqlx::types::time::OffsetDateTime, + sqlx::types::time::Date, #[cfg(feature = "uuid")] sqlx::types::Uuid,