Skip to content

Commit

Permalink
sqlite date macro support (#2491)
Browse files Browse the repository at this point in the history
* 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.
  • Loading branch information
Arcayr authored Jun 30, 2023
1 parent 87ff645 commit 4b254ea
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion sqlx-macros-core/src/database/sqlite.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,23 @@ impl_database_ext! {
String,
Vec<u8>,

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

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

#[cfg(feature = "chrono")]
sqlx::types::chrono::DateTime<sqlx::types::chrono::Utc> | 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,
Expand Down

0 comments on commit 4b254ea

Please sign in to comment.