From a41f97932c4cfbace9849e8ebb75afe9ee53de31 Mon Sep 17 00:00:00 2001 From: Georg Semmler Date: Mon, 7 Aug 2023 13:01:31 +0000 Subject: [PATCH] Merge pull request #3734 from surban/fix-datetimeproxy time: sql_type for DateTimeProxy without backend --- diesel/src/type_impls/date_and_time.rs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/diesel/src/type_impls/date_and_time.rs b/diesel/src/type_impls/date_and_time.rs index b189fc275e1e..651a2cc33c87 100644 --- a/diesel/src/type_impls/date_and_time.rs +++ b/diesel/src/type_impls/date_and_time.rs @@ -79,8 +79,16 @@ mod time { #[cfg_attr(feature = "mysql_backend", diesel(sql_type = crate::sql_types::Datetime))] struct NaiveDateTimeProxy(PrimitiveDateTime); - #[derive(AsExpression, FromSqlRow)] + #[derive(FromSqlRow)] #[diesel(foreign_derive)] + #[cfg_attr( + any( + feature = "postgres_backend", + feature = "sqlite", + feature = "mysql_backend" + ), + derive(AsExpression) + )] #[cfg_attr( feature = "postgres_backend", diesel(sql_type = crate::sql_types::Timestamptz)