Skip to main content

diesel/type_impls/
date_and_time.rs

1#![allow(dead_code)]
2
3#[cfg(feature = "std")]
4mod std {
5    use crate::deserialize::FromSqlRow;
6    use crate::expression::AsExpression;
7
8    #[derive(const _: () =
    {
        use diesel;
        impl<'__expr>
            diesel::expression::AsExpression<crate::sql_types::Timestamp> for
            &'__expr std::time::SystemTime {
            type Expression =
                diesel::internal::derives::as_expression::Bound<crate::sql_types::Timestamp,
                Self>;
            fn as_expression(self)
                ->
                    <Self as
                    diesel::expression::AsExpression<crate::sql_types::Timestamp>>::Expression {
                diesel::internal::derives::as_expression::Bound::new(self)
            }
        }
        impl<'__expr>
            diesel::expression::AsExpression<diesel::sql_types::Nullable<crate::sql_types::Timestamp>>
            for &'__expr std::time::SystemTime {
            type Expression =
                diesel::internal::derives::as_expression::Bound<diesel::sql_types::Nullable<crate::sql_types::Timestamp>,
                Self>;
            fn as_expression(self)
                ->
                    <Self as
                    diesel::expression::AsExpression<diesel::sql_types::Nullable<crate::sql_types::Timestamp>>>::Expression {
                diesel::internal::derives::as_expression::Bound::new(self)
            }
        }
        impl<'__expr, '__expr2>
            diesel::expression::AsExpression<crate::sql_types::Timestamp> for
            &'__expr2 &'__expr std::time::SystemTime {
            type Expression =
                diesel::internal::derives::as_expression::Bound<crate::sql_types::Timestamp,
                Self>;
            fn as_expression(self)
                ->
                    <Self as
                    diesel::expression::AsExpression<crate::sql_types::Timestamp>>::Expression {
                diesel::internal::derives::as_expression::Bound::new(self)
            }
        }
        impl<'__expr, '__expr2>
            diesel::expression::AsExpression<diesel::sql_types::Nullable<crate::sql_types::Timestamp>>
            for &'__expr2 &'__expr std::time::SystemTime {
            type Expression =
                diesel::internal::derives::as_expression::Bound<diesel::sql_types::Nullable<crate::sql_types::Timestamp>,
                Self>;
            fn as_expression(self)
                ->
                    <Self as
                    diesel::expression::AsExpression<diesel::sql_types::Nullable<crate::sql_types::Timestamp>>>::Expression {
                diesel::internal::derives::as_expression::Bound::new(self)
            }
        }
        impl<__DB>
            diesel::serialize::ToSql<diesel::sql_types::Nullable<crate::sql_types::Timestamp>,
            __DB> for std::time::SystemTime where
            __DB: diesel::backend::Backend,
            Self: diesel::serialize::ToSql<crate::sql_types::Timestamp, __DB>
            {
            fn to_sql<'__b>(&'__b self,
                out: &mut diesel::serialize::Output<'__b, '_, __DB>)
                -> diesel::serialize::Result {
                diesel::serialize::ToSql::<crate::sql_types::Timestamp,
                        __DB>::to_sql(self, out)
            }
        }
        impl diesel::expression::AsExpression<crate::sql_types::Timestamp> for
            std::time::SystemTime {
            type Expression =
                diesel::internal::derives::as_expression::Bound<crate::sql_types::Timestamp,
                Self>;
            fn as_expression(self)
                ->
                    <Self as
                    diesel::expression::AsExpression<crate::sql_types::Timestamp>>::Expression {
                diesel::internal::derives::as_expression::Bound::new(self)
            }
        }
        impl diesel::expression::AsExpression<diesel::sql_types::Nullable<crate::sql_types::Timestamp>>
            for std::time::SystemTime {
            type Expression =
                diesel::internal::derives::as_expression::Bound<diesel::sql_types::Nullable<crate::sql_types::Timestamp>,
                Self>;
            fn as_expression(self)
                ->
                    <Self as
                    diesel::expression::AsExpression<diesel::sql_types::Nullable<crate::sql_types::Timestamp>>>::Expression {
                diesel::internal::derives::as_expression::Bound::new(self)
            }
        }
    };AsExpression, const _: () =
    {
        use diesel;
        impl<__DB, __ST> diesel::deserialize::Queryable<__ST, __DB> for
            std::time::SystemTime where __DB: diesel::backend::Backend,
            __ST: diesel::sql_types::SingleValue,
            Self: diesel::deserialize::FromSql<__ST, __DB> {
            type Row = Self;
            fn build(row: Self) -> diesel::deserialize::Result<Self> {
                diesel::deserialize::Result::Ok(row)
            }
        }
    };FromSqlRow)]
9    #[diesel(foreign_derive)]
10    #[diesel(sql_type = crate::sql_types::Timestamp)]
11    struct SystemTimeProxy(std::time::SystemTime);
12}
13
14#[cfg(feature = "chrono")]
15mod chrono {
16    extern crate chrono;
17    use self::chrono::*;
18    use crate::deserialize::FromSqlRow;
19    use crate::expression::AsExpression;
20    use crate::sql_types::{Date, Interval, Time, Timestamp};
21
22    #[derive(const _: () =
    {
        use diesel;
        impl<'__expr> diesel::expression::AsExpression<Date> for
            &'__expr NaiveDate {
            type Expression =
                diesel::internal::derives::as_expression::Bound<Date, Self>;
            fn as_expression(self)
                ->
                    <Self as
                    diesel::expression::AsExpression<Date>>::Expression {
                diesel::internal::derives::as_expression::Bound::new(self)
            }
        }
        impl<'__expr>
            diesel::expression::AsExpression<diesel::sql_types::Nullable<Date>>
            for &'__expr NaiveDate {
            type Expression =
                diesel::internal::derives::as_expression::Bound<diesel::sql_types::Nullable<Date>,
                Self>;
            fn as_expression(self)
                ->
                    <Self as
                    diesel::expression::AsExpression<diesel::sql_types::Nullable<Date>>>::Expression {
                diesel::internal::derives::as_expression::Bound::new(self)
            }
        }
        impl<'__expr, '__expr2> diesel::expression::AsExpression<Date> for
            &'__expr2 &'__expr NaiveDate {
            type Expression =
                diesel::internal::derives::as_expression::Bound<Date, Self>;
            fn as_expression(self)
                ->
                    <Self as
                    diesel::expression::AsExpression<Date>>::Expression {
                diesel::internal::derives::as_expression::Bound::new(self)
            }
        }
        impl<'__expr, '__expr2>
            diesel::expression::AsExpression<diesel::sql_types::Nullable<Date>>
            for &'__expr2 &'__expr NaiveDate {
            type Expression =
                diesel::internal::derives::as_expression::Bound<diesel::sql_types::Nullable<Date>,
                Self>;
            fn as_expression(self)
                ->
                    <Self as
                    diesel::expression::AsExpression<diesel::sql_types::Nullable<Date>>>::Expression {
                diesel::internal::derives::as_expression::Bound::new(self)
            }
        }
        impl<__DB>
            diesel::serialize::ToSql<diesel::sql_types::Nullable<Date>, __DB>
            for NaiveDate where __DB: diesel::backend::Backend,
            Self: diesel::serialize::ToSql<Date, __DB> {
            fn to_sql<'__b>(&'__b self,
                out: &mut diesel::serialize::Output<'__b, '_, __DB>)
                -> diesel::serialize::Result {
                diesel::serialize::ToSql::<Date, __DB>::to_sql(self, out)
            }
        }
        impl diesel::expression::AsExpression<Date> for NaiveDate {
            type Expression =
                diesel::internal::derives::as_expression::Bound<Date, Self>;
            fn as_expression(self)
                ->
                    <Self as
                    diesel::expression::AsExpression<Date>>::Expression {
                diesel::internal::derives::as_expression::Bound::new(self)
            }
        }
        impl diesel::expression::AsExpression<diesel::sql_types::Nullable<Date>>
            for NaiveDate {
            type Expression =
                diesel::internal::derives::as_expression::Bound<diesel::sql_types::Nullable<Date>,
                Self>;
            fn as_expression(self)
                ->
                    <Self as
                    diesel::expression::AsExpression<diesel::sql_types::Nullable<Date>>>::Expression {
                diesel::internal::derives::as_expression::Bound::new(self)
            }
        }
    };AsExpression, const _: () =
    {
        use diesel;
        impl<__DB, __ST> diesel::deserialize::Queryable<__ST, __DB> for
            NaiveDate where __DB: diesel::backend::Backend,
            __ST: diesel::sql_types::SingleValue,
            Self: diesel::deserialize::FromSql<__ST, __DB> {
            type Row = Self;
            fn build(row: Self) -> diesel::deserialize::Result<Self> {
                diesel::deserialize::Result::Ok(row)
            }
        }
    };FromSqlRow)]
23    #[diesel(foreign_derive)]
24    #[diesel(sql_type = Date)]
25    struct NaiveDateProxy(NaiveDate);
26
27    #[derive(const _: () =
    {
        use diesel;
        impl<'__expr> diesel::expression::AsExpression<Time> for
            &'__expr NaiveTime {
            type Expression =
                diesel::internal::derives::as_expression::Bound<Time, Self>;
            fn as_expression(self)
                ->
                    <Self as
                    diesel::expression::AsExpression<Time>>::Expression {
                diesel::internal::derives::as_expression::Bound::new(self)
            }
        }
        impl<'__expr>
            diesel::expression::AsExpression<diesel::sql_types::Nullable<Time>>
            for &'__expr NaiveTime {
            type Expression =
                diesel::internal::derives::as_expression::Bound<diesel::sql_types::Nullable<Time>,
                Self>;
            fn as_expression(self)
                ->
                    <Self as
                    diesel::expression::AsExpression<diesel::sql_types::Nullable<Time>>>::Expression {
                diesel::internal::derives::as_expression::Bound::new(self)
            }
        }
        impl<'__expr, '__expr2> diesel::expression::AsExpression<Time> for
            &'__expr2 &'__expr NaiveTime {
            type Expression =
                diesel::internal::derives::as_expression::Bound<Time, Self>;
            fn as_expression(self)
                ->
                    <Self as
                    diesel::expression::AsExpression<Time>>::Expression {
                diesel::internal::derives::as_expression::Bound::new(self)
            }
        }
        impl<'__expr, '__expr2>
            diesel::expression::AsExpression<diesel::sql_types::Nullable<Time>>
            for &'__expr2 &'__expr NaiveTime {
            type Expression =
                diesel::internal::derives::as_expression::Bound<diesel::sql_types::Nullable<Time>,
                Self>;
            fn as_expression(self)
                ->
                    <Self as
                    diesel::expression::AsExpression<diesel::sql_types::Nullable<Time>>>::Expression {
                diesel::internal::derives::as_expression::Bound::new(self)
            }
        }
        impl<__DB>
            diesel::serialize::ToSql<diesel::sql_types::Nullable<Time>, __DB>
            for NaiveTime where __DB: diesel::backend::Backend,
            Self: diesel::serialize::ToSql<Time, __DB> {
            fn to_sql<'__b>(&'__b self,
                out: &mut diesel::serialize::Output<'__b, '_, __DB>)
                -> diesel::serialize::Result {
                diesel::serialize::ToSql::<Time, __DB>::to_sql(self, out)
            }
        }
        impl diesel::expression::AsExpression<Time> for NaiveTime {
            type Expression =
                diesel::internal::derives::as_expression::Bound<Time, Self>;
            fn as_expression(self)
                ->
                    <Self as
                    diesel::expression::AsExpression<Time>>::Expression {
                diesel::internal::derives::as_expression::Bound::new(self)
            }
        }
        impl diesel::expression::AsExpression<diesel::sql_types::Nullable<Time>>
            for NaiveTime {
            type Expression =
                diesel::internal::derives::as_expression::Bound<diesel::sql_types::Nullable<Time>,
                Self>;
            fn as_expression(self)
                ->
                    <Self as
                    diesel::expression::AsExpression<diesel::sql_types::Nullable<Time>>>::Expression {
                diesel::internal::derives::as_expression::Bound::new(self)
            }
        }
    };AsExpression, const _: () =
    {
        use diesel;
        impl<__DB, __ST> diesel::deserialize::Queryable<__ST, __DB> for
            NaiveTime where __DB: diesel::backend::Backend,
            __ST: diesel::sql_types::SingleValue,
            Self: diesel::deserialize::FromSql<__ST, __DB> {
            type Row = Self;
            fn build(row: Self) -> diesel::deserialize::Result<Self> {
                diesel::deserialize::Result::Ok(row)
            }
        }
    };FromSqlRow)]
28    #[diesel(foreign_derive)]
29    #[diesel(sql_type = Time)]
30    struct NaiveTimeProxy(NaiveTime);
31
32    #[derive(const _: () =
    {
        use diesel;
        impl<'__expr> diesel::expression::AsExpression<Timestamp> for
            &'__expr NaiveDateTime {
            type Expression =
                diesel::internal::derives::as_expression::Bound<Timestamp,
                Self>;
            fn as_expression(self)
                ->
                    <Self as
                    diesel::expression::AsExpression<Timestamp>>::Expression {
                diesel::internal::derives::as_expression::Bound::new(self)
            }
        }
        impl<'__expr>
            diesel::expression::AsExpression<diesel::sql_types::Nullable<Timestamp>>
            for &'__expr NaiveDateTime {
            type Expression =
                diesel::internal::derives::as_expression::Bound<diesel::sql_types::Nullable<Timestamp>,
                Self>;
            fn as_expression(self)
                ->
                    <Self as
                    diesel::expression::AsExpression<diesel::sql_types::Nullable<Timestamp>>>::Expression {
                diesel::internal::derives::as_expression::Bound::new(self)
            }
        }
        impl<'__expr, '__expr2> diesel::expression::AsExpression<Timestamp>
            for &'__expr2 &'__expr NaiveDateTime {
            type Expression =
                diesel::internal::derives::as_expression::Bound<Timestamp,
                Self>;
            fn as_expression(self)
                ->
                    <Self as
                    diesel::expression::AsExpression<Timestamp>>::Expression {
                diesel::internal::derives::as_expression::Bound::new(self)
            }
        }
        impl<'__expr, '__expr2>
            diesel::expression::AsExpression<diesel::sql_types::Nullable<Timestamp>>
            for &'__expr2 &'__expr NaiveDateTime {
            type Expression =
                diesel::internal::derives::as_expression::Bound<diesel::sql_types::Nullable<Timestamp>,
                Self>;
            fn as_expression(self)
                ->
                    <Self as
                    diesel::expression::AsExpression<diesel::sql_types::Nullable<Timestamp>>>::Expression {
                diesel::internal::derives::as_expression::Bound::new(self)
            }
        }
        impl<__DB>
            diesel::serialize::ToSql<diesel::sql_types::Nullable<Timestamp>,
            __DB> for NaiveDateTime where __DB: diesel::backend::Backend,
            Self: diesel::serialize::ToSql<Timestamp, __DB> {
            fn to_sql<'__b>(&'__b self,
                out: &mut diesel::serialize::Output<'__b, '_, __DB>)
                -> diesel::serialize::Result {
                diesel::serialize::ToSql::<Timestamp, __DB>::to_sql(self, out)
            }
        }
        impl diesel::expression::AsExpression<Timestamp> for NaiveDateTime {
            type Expression =
                diesel::internal::derives::as_expression::Bound<Timestamp,
                Self>;
            fn as_expression(self)
                ->
                    <Self as
                    diesel::expression::AsExpression<Timestamp>>::Expression {
                diesel::internal::derives::as_expression::Bound::new(self)
            }
        }
        impl diesel::expression::AsExpression<diesel::sql_types::Nullable<Timestamp>>
            for NaiveDateTime {
            type Expression =
                diesel::internal::derives::as_expression::Bound<diesel::sql_types::Nullable<Timestamp>,
                Self>;
            fn as_expression(self)
                ->
                    <Self as
                    diesel::expression::AsExpression<diesel::sql_types::Nullable<Timestamp>>>::Expression {
                diesel::internal::derives::as_expression::Bound::new(self)
            }
        }
        impl<'__expr>
            diesel::expression::AsExpression<crate::sql_types::Timestamptz>
            for &'__expr NaiveDateTime {
            type Expression =
                diesel::internal::derives::as_expression::Bound<crate::sql_types::Timestamptz,
                Self>;
            fn as_expression(self)
                ->
                    <Self as
                    diesel::expression::AsExpression<crate::sql_types::Timestamptz>>::Expression {
                diesel::internal::derives::as_expression::Bound::new(self)
            }
        }
        impl<'__expr>
            diesel::expression::AsExpression<diesel::sql_types::Nullable<crate::sql_types::Timestamptz>>
            for &'__expr NaiveDateTime {
            type Expression =
                diesel::internal::derives::as_expression::Bound<diesel::sql_types::Nullable<crate::sql_types::Timestamptz>,
                Self>;
            fn as_expression(self)
                ->
                    <Self as
                    diesel::expression::AsExpression<diesel::sql_types::Nullable<crate::sql_types::Timestamptz>>>::Expression {
                diesel::internal::derives::as_expression::Bound::new(self)
            }
        }
        impl<'__expr, '__expr2>
            diesel::expression::AsExpression<crate::sql_types::Timestamptz>
            for &'__expr2 &'__expr NaiveDateTime {
            type Expression =
                diesel::internal::derives::as_expression::Bound<crate::sql_types::Timestamptz,
                Self>;
            fn as_expression(self)
                ->
                    <Self as
                    diesel::expression::AsExpression<crate::sql_types::Timestamptz>>::Expression {
                diesel::internal::derives::as_expression::Bound::new(self)
            }
        }
        impl<'__expr, '__expr2>
            diesel::expression::AsExpression<diesel::sql_types::Nullable<crate::sql_types::Timestamptz>>
            for &'__expr2 &'__expr NaiveDateTime {
            type Expression =
                diesel::internal::derives::as_expression::Bound<diesel::sql_types::Nullable<crate::sql_types::Timestamptz>,
                Self>;
            fn as_expression(self)
                ->
                    <Self as
                    diesel::expression::AsExpression<diesel::sql_types::Nullable<crate::sql_types::Timestamptz>>>::Expression {
                diesel::internal::derives::as_expression::Bound::new(self)
            }
        }
        impl<__DB>
            diesel::serialize::ToSql<diesel::sql_types::Nullable<crate::sql_types::Timestamptz>,
            __DB> for NaiveDateTime where __DB: diesel::backend::Backend,
            Self: diesel::serialize::ToSql<crate::sql_types::Timestamptz,
            __DB> {
            fn to_sql<'__b>(&'__b self,
                out: &mut diesel::serialize::Output<'__b, '_, __DB>)
                -> diesel::serialize::Result {
                diesel::serialize::ToSql::<crate::sql_types::Timestamptz,
                        __DB>::to_sql(self, out)
            }
        }
        impl diesel::expression::AsExpression<crate::sql_types::Timestamptz>
            for NaiveDateTime {
            type Expression =
                diesel::internal::derives::as_expression::Bound<crate::sql_types::Timestamptz,
                Self>;
            fn as_expression(self)
                ->
                    <Self as
                    diesel::expression::AsExpression<crate::sql_types::Timestamptz>>::Expression {
                diesel::internal::derives::as_expression::Bound::new(self)
            }
        }
        impl diesel::expression::AsExpression<diesel::sql_types::Nullable<crate::sql_types::Timestamptz>>
            for NaiveDateTime {
            type Expression =
                diesel::internal::derives::as_expression::Bound<diesel::sql_types::Nullable<crate::sql_types::Timestamptz>,
                Self>;
            fn as_expression(self)
                ->
                    <Self as
                    diesel::expression::AsExpression<diesel::sql_types::Nullable<crate::sql_types::Timestamptz>>>::Expression {
                diesel::internal::derives::as_expression::Bound::new(self)
            }
        }
        impl<'__expr>
            diesel::expression::AsExpression<crate::sql_types::Datetime> for
            &'__expr NaiveDateTime {
            type Expression =
                diesel::internal::derives::as_expression::Bound<crate::sql_types::Datetime,
                Self>;
            fn as_expression(self)
                ->
                    <Self as
                    diesel::expression::AsExpression<crate::sql_types::Datetime>>::Expression {
                diesel::internal::derives::as_expression::Bound::new(self)
            }
        }
        impl<'__expr>
            diesel::expression::AsExpression<diesel::sql_types::Nullable<crate::sql_types::Datetime>>
            for &'__expr NaiveDateTime {
            type Expression =
                diesel::internal::derives::as_expression::Bound<diesel::sql_types::Nullable<crate::sql_types::Datetime>,
                Self>;
            fn as_expression(self)
                ->
                    <Self as
                    diesel::expression::AsExpression<diesel::sql_types::Nullable<crate::sql_types::Datetime>>>::Expression {
                diesel::internal::derives::as_expression::Bound::new(self)
            }
        }
        impl<'__expr, '__expr2>
            diesel::expression::AsExpression<crate::sql_types::Datetime> for
            &'__expr2 &'__expr NaiveDateTime {
            type Expression =
                diesel::internal::derives::as_expression::Bound<crate::sql_types::Datetime,
                Self>;
            fn as_expression(self)
                ->
                    <Self as
                    diesel::expression::AsExpression<crate::sql_types::Datetime>>::Expression {
                diesel::internal::derives::as_expression::Bound::new(self)
            }
        }
        impl<'__expr, '__expr2>
            diesel::expression::AsExpression<diesel::sql_types::Nullable<crate::sql_types::Datetime>>
            for &'__expr2 &'__expr NaiveDateTime {
            type Expression =
                diesel::internal::derives::as_expression::Bound<diesel::sql_types::Nullable<crate::sql_types::Datetime>,
                Self>;
            fn as_expression(self)
                ->
                    <Self as
                    diesel::expression::AsExpression<diesel::sql_types::Nullable<crate::sql_types::Datetime>>>::Expression {
                diesel::internal::derives::as_expression::Bound::new(self)
            }
        }
        impl<__DB>
            diesel::serialize::ToSql<diesel::sql_types::Nullable<crate::sql_types::Datetime>,
            __DB> for NaiveDateTime where __DB: diesel::backend::Backend,
            Self: diesel::serialize::ToSql<crate::sql_types::Datetime, __DB> {
            fn to_sql<'__b>(&'__b self,
                out: &mut diesel::serialize::Output<'__b, '_, __DB>)
                -> diesel::serialize::Result {
                diesel::serialize::ToSql::<crate::sql_types::Datetime,
                        __DB>::to_sql(self, out)
            }
        }
        impl diesel::expression::AsExpression<crate::sql_types::Datetime> for
            NaiveDateTime {
            type Expression =
                diesel::internal::derives::as_expression::Bound<crate::sql_types::Datetime,
                Self>;
            fn as_expression(self)
                ->
                    <Self as
                    diesel::expression::AsExpression<crate::sql_types::Datetime>>::Expression {
                diesel::internal::derives::as_expression::Bound::new(self)
            }
        }
        impl diesel::expression::AsExpression<diesel::sql_types::Nullable<crate::sql_types::Datetime>>
            for NaiveDateTime {
            type Expression =
                diesel::internal::derives::as_expression::Bound<diesel::sql_types::Nullable<crate::sql_types::Datetime>,
                Self>;
            fn as_expression(self)
                ->
                    <Self as
                    diesel::expression::AsExpression<diesel::sql_types::Nullable<crate::sql_types::Datetime>>>::Expression {
                diesel::internal::derives::as_expression::Bound::new(self)
            }
        }
    };AsExpression, const _: () =
    {
        use diesel;
        impl<__DB, __ST> diesel::deserialize::Queryable<__ST, __DB> for
            NaiveDateTime where __DB: diesel::backend::Backend,
            __ST: diesel::sql_types::SingleValue,
            Self: diesel::deserialize::FromSql<__ST, __DB> {
            type Row = Self;
            fn build(row: Self) -> diesel::deserialize::Result<Self> {
                diesel::deserialize::Result::Ok(row)
            }
        }
    };FromSqlRow)]
33    #[diesel(foreign_derive)]
34    #[diesel(sql_type = Timestamp)]
35    #[cfg_attr(
36        feature = "postgres_backend",
37        diesel(sql_type = crate::sql_types::Timestamptz)
38    )]
39    #[cfg_attr(feature = "mysql_backend", diesel(sql_type = crate::sql_types::Datetime))]
40    struct NaiveDateTimeProxy(NaiveDateTime);
41
42    #[derive(const _: () =
    {
        use diesel;
        impl<Tz: TimeZone, __DB, __ST>
            diesel::deserialize::Queryable<__ST, __DB> for DateTime<Tz> where
            __DB: diesel::backend::Backend,
            __ST: diesel::sql_types::SingleValue,
            Self: diesel::deserialize::FromSql<__ST, __DB> {
            type Row = Self;
            fn build(row: Self) -> diesel::deserialize::Result<Self> {
                diesel::deserialize::Result::Ok(row)
            }
        }
    };FromSqlRow)]
43    #[diesel(foreign_derive)]
44    #[cfg_attr(
45        any(feature = "postgres_backend", feature = "__sqlite-shared"),
46        derive(const _: () =
    {
        use diesel;
        impl<'__expr, Tz: TimeZone>
            diesel::expression::AsExpression<crate::sql_types::Timestamptz>
            for &'__expr DateTime<Tz> {
            type Expression =
                diesel::internal::derives::as_expression::Bound<crate::sql_types::Timestamptz,
                Self>;
            fn as_expression(self)
                ->
                    <Self as
                    diesel::expression::AsExpression<crate::sql_types::Timestamptz>>::Expression {
                diesel::internal::derives::as_expression::Bound::new(self)
            }
        }
        impl<'__expr, Tz: TimeZone>
            diesel::expression::AsExpression<diesel::sql_types::Nullable<crate::sql_types::Timestamptz>>
            for &'__expr DateTime<Tz> {
            type Expression =
                diesel::internal::derives::as_expression::Bound<diesel::sql_types::Nullable<crate::sql_types::Timestamptz>,
                Self>;
            fn as_expression(self)
                ->
                    <Self as
                    diesel::expression::AsExpression<diesel::sql_types::Nullable<crate::sql_types::Timestamptz>>>::Expression {
                diesel::internal::derives::as_expression::Bound::new(self)
            }
        }
        impl<'__expr, '__expr2, Tz: TimeZone>
            diesel::expression::AsExpression<crate::sql_types::Timestamptz>
            for &'__expr2 &'__expr DateTime<Tz> {
            type Expression =
                diesel::internal::derives::as_expression::Bound<crate::sql_types::Timestamptz,
                Self>;
            fn as_expression(self)
                ->
                    <Self as
                    diesel::expression::AsExpression<crate::sql_types::Timestamptz>>::Expression {
                diesel::internal::derives::as_expression::Bound::new(self)
            }
        }
        impl<'__expr, '__expr2, Tz: TimeZone>
            diesel::expression::AsExpression<diesel::sql_types::Nullable<crate::sql_types::Timestamptz>>
            for &'__expr2 &'__expr DateTime<Tz> {
            type Expression =
                diesel::internal::derives::as_expression::Bound<diesel::sql_types::Nullable<crate::sql_types::Timestamptz>,
                Self>;
            fn as_expression(self)
                ->
                    <Self as
                    diesel::expression::AsExpression<diesel::sql_types::Nullable<crate::sql_types::Timestamptz>>>::Expression {
                diesel::internal::derives::as_expression::Bound::new(self)
            }
        }
        impl<Tz: TimeZone, __DB>
            diesel::serialize::ToSql<diesel::sql_types::Nullable<crate::sql_types::Timestamptz>,
            __DB> for DateTime<Tz> where __DB: diesel::backend::Backend,
            Self: diesel::serialize::ToSql<crate::sql_types::Timestamptz,
            __DB> {
            fn to_sql<'__b>(&'__b self,
                out: &mut diesel::serialize::Output<'__b, '_, __DB>)
                -> diesel::serialize::Result {
                diesel::serialize::ToSql::<crate::sql_types::Timestamptz,
                        __DB>::to_sql(self, out)
            }
        }
        impl<Tz: TimeZone>
            diesel::expression::AsExpression<crate::sql_types::Timestamptz>
            for DateTime<Tz> {
            type Expression =
                diesel::internal::derives::as_expression::Bound<crate::sql_types::Timestamptz,
                Self>;
            fn as_expression(self)
                ->
                    <Self as
                    diesel::expression::AsExpression<crate::sql_types::Timestamptz>>::Expression {
                diesel::internal::derives::as_expression::Bound::new(self)
            }
        }
        impl<Tz: TimeZone>
            diesel::expression::AsExpression<diesel::sql_types::Nullable<crate::sql_types::Timestamptz>>
            for DateTime<Tz> {
            type Expression =
                diesel::internal::derives::as_expression::Bound<diesel::sql_types::Nullable<crate::sql_types::Timestamptz>,
                Self>;
            fn as_expression(self)
                ->
                    <Self as
                    diesel::expression::AsExpression<diesel::sql_types::Nullable<crate::sql_types::Timestamptz>>>::Expression {
                diesel::internal::derives::as_expression::Bound::new(self)
            }
        }
        impl<'__expr, Tz: TimeZone>
            diesel::expression::AsExpression<crate::sql_types::TimestamptzSqlite>
            for &'__expr DateTime<Tz> {
            type Expression =
                diesel::internal::derives::as_expression::Bound<crate::sql_types::TimestamptzSqlite,
                Self>;
            fn as_expression(self)
                ->
                    <Self as
                    diesel::expression::AsExpression<crate::sql_types::TimestamptzSqlite>>::Expression {
                diesel::internal::derives::as_expression::Bound::new(self)
            }
        }
        impl<'__expr, Tz: TimeZone>
            diesel::expression::AsExpression<diesel::sql_types::Nullable<crate::sql_types::TimestamptzSqlite>>
            for &'__expr DateTime<Tz> {
            type Expression =
                diesel::internal::derives::as_expression::Bound<diesel::sql_types::Nullable<crate::sql_types::TimestamptzSqlite>,
                Self>;
            fn as_expression(self)
                ->
                    <Self as
                    diesel::expression::AsExpression<diesel::sql_types::Nullable<crate::sql_types::TimestamptzSqlite>>>::Expression {
                diesel::internal::derives::as_expression::Bound::new(self)
            }
        }
        impl<'__expr, '__expr2, Tz: TimeZone>
            diesel::expression::AsExpression<crate::sql_types::TimestamptzSqlite>
            for &'__expr2 &'__expr DateTime<Tz> {
            type Expression =
                diesel::internal::derives::as_expression::Bound<crate::sql_types::TimestamptzSqlite,
                Self>;
            fn as_expression(self)
                ->
                    <Self as
                    diesel::expression::AsExpression<crate::sql_types::TimestamptzSqlite>>::Expression {
                diesel::internal::derives::as_expression::Bound::new(self)
            }
        }
        impl<'__expr, '__expr2, Tz: TimeZone>
            diesel::expression::AsExpression<diesel::sql_types::Nullable<crate::sql_types::TimestamptzSqlite>>
            for &'__expr2 &'__expr DateTime<Tz> {
            type Expression =
                diesel::internal::derives::as_expression::Bound<diesel::sql_types::Nullable<crate::sql_types::TimestamptzSqlite>,
                Self>;
            fn as_expression(self)
                ->
                    <Self as
                    diesel::expression::AsExpression<diesel::sql_types::Nullable<crate::sql_types::TimestamptzSqlite>>>::Expression {
                diesel::internal::derives::as_expression::Bound::new(self)
            }
        }
        impl<Tz: TimeZone, __DB>
            diesel::serialize::ToSql<diesel::sql_types::Nullable<crate::sql_types::TimestamptzSqlite>,
            __DB> for DateTime<Tz> where __DB: diesel::backend::Backend,
            Self: diesel::serialize::ToSql<crate::sql_types::TimestamptzSqlite,
            __DB> {
            fn to_sql<'__b>(&'__b self,
                out: &mut diesel::serialize::Output<'__b, '_, __DB>)
                -> diesel::serialize::Result {
                diesel::serialize::ToSql::<crate::sql_types::TimestamptzSqlite,
                        __DB>::to_sql(self, out)
            }
        }
        impl<Tz: TimeZone>
            diesel::expression::AsExpression<crate::sql_types::TimestamptzSqlite>
            for DateTime<Tz> {
            type Expression =
                diesel::internal::derives::as_expression::Bound<crate::sql_types::TimestamptzSqlite,
                Self>;
            fn as_expression(self)
                ->
                    <Self as
                    diesel::expression::AsExpression<crate::sql_types::TimestamptzSqlite>>::Expression {
                diesel::internal::derives::as_expression::Bound::new(self)
            }
        }
        impl<Tz: TimeZone>
            diesel::expression::AsExpression<diesel::sql_types::Nullable<crate::sql_types::TimestamptzSqlite>>
            for DateTime<Tz> {
            type Expression =
                diesel::internal::derives::as_expression::Bound<diesel::sql_types::Nullable<crate::sql_types::TimestamptzSqlite>,
                Self>;
            fn as_expression(self)
                ->
                    <Self as
                    diesel::expression::AsExpression<diesel::sql_types::Nullable<crate::sql_types::TimestamptzSqlite>>>::Expression {
                diesel::internal::derives::as_expression::Bound::new(self)
            }
        }
    };AsExpression)
47    )]
48    #[cfg_attr(
49        feature = "postgres_backend",
50        diesel(sql_type = crate::sql_types::Timestamptz)
51    )]
52    #[cfg_attr(feature = "__sqlite-shared", diesel(sql_type = crate::sql_types::TimestamptzSqlite))]
53    struct DateTimeProxy<Tz: TimeZone>(DateTime<Tz>);
54
55    #[derive(const _: () =
    {
        use diesel;
        impl<'__expr> diesel::expression::AsExpression<Interval> for
            &'__expr Duration {
            type Expression =
                diesel::internal::derives::as_expression::Bound<Interval,
                Self>;
            fn as_expression(self)
                ->
                    <Self as
                    diesel::expression::AsExpression<Interval>>::Expression {
                diesel::internal::derives::as_expression::Bound::new(self)
            }
        }
        impl<'__expr>
            diesel::expression::AsExpression<diesel::sql_types::Nullable<Interval>>
            for &'__expr Duration {
            type Expression =
                diesel::internal::derives::as_expression::Bound<diesel::sql_types::Nullable<Interval>,
                Self>;
            fn as_expression(self)
                ->
                    <Self as
                    diesel::expression::AsExpression<diesel::sql_types::Nullable<Interval>>>::Expression {
                diesel::internal::derives::as_expression::Bound::new(self)
            }
        }
        impl<'__expr, '__expr2> diesel::expression::AsExpression<Interval> for
            &'__expr2 &'__expr Duration {
            type Expression =
                diesel::internal::derives::as_expression::Bound<Interval,
                Self>;
            fn as_expression(self)
                ->
                    <Self as
                    diesel::expression::AsExpression<Interval>>::Expression {
                diesel::internal::derives::as_expression::Bound::new(self)
            }
        }
        impl<'__expr, '__expr2>
            diesel::expression::AsExpression<diesel::sql_types::Nullable<Interval>>
            for &'__expr2 &'__expr Duration {
            type Expression =
                diesel::internal::derives::as_expression::Bound<diesel::sql_types::Nullable<Interval>,
                Self>;
            fn as_expression(self)
                ->
                    <Self as
                    diesel::expression::AsExpression<diesel::sql_types::Nullable<Interval>>>::Expression {
                diesel::internal::derives::as_expression::Bound::new(self)
            }
        }
        impl<__DB>
            diesel::serialize::ToSql<diesel::sql_types::Nullable<Interval>,
            __DB> for Duration where __DB: diesel::backend::Backend,
            Self: diesel::serialize::ToSql<Interval, __DB> {
            fn to_sql<'__b>(&'__b self,
                out: &mut diesel::serialize::Output<'__b, '_, __DB>)
                -> diesel::serialize::Result {
                diesel::serialize::ToSql::<Interval, __DB>::to_sql(self, out)
            }
        }
        impl diesel::expression::AsExpression<Interval> for Duration {
            type Expression =
                diesel::internal::derives::as_expression::Bound<Interval,
                Self>;
            fn as_expression(self)
                ->
                    <Self as
                    diesel::expression::AsExpression<Interval>>::Expression {
                diesel::internal::derives::as_expression::Bound::new(self)
            }
        }
        impl diesel::expression::AsExpression<diesel::sql_types::Nullable<Interval>>
            for Duration {
            type Expression =
                diesel::internal::derives::as_expression::Bound<diesel::sql_types::Nullable<Interval>,
                Self>;
            fn as_expression(self)
                ->
                    <Self as
                    diesel::expression::AsExpression<diesel::sql_types::Nullable<Interval>>>::Expression {
                diesel::internal::derives::as_expression::Bound::new(self)
            }
        }
    };AsExpression, const _: () =
    {
        use diesel;
        impl<__DB, __ST> diesel::deserialize::Queryable<__ST, __DB> for
            Duration where __DB: diesel::backend::Backend,
            __ST: diesel::sql_types::SingleValue,
            Self: diesel::deserialize::FromSql<__ST, __DB> {
            type Row = Self;
            fn build(row: Self) -> diesel::deserialize::Result<Self> {
                diesel::deserialize::Result::Ok(row)
            }
        }
    };FromSqlRow)]
56    #[diesel(foreign_derive)]
57    #[diesel(sql_type = Interval)]
58    struct DurationProxy(Duration);
59}
60
61#[cfg(feature = "time")]
62mod time {
63    use time::{Date as NaiveDate, OffsetDateTime, PrimitiveDateTime, Time as NaiveTime};
64
65    use crate::deserialize::FromSqlRow;
66    use crate::expression::AsExpression;
67    use crate::sql_types::{Date, Time, Timestamp};
68
69    #[derive(const _: () =
    {
        use diesel;
        impl<'__expr> diesel::expression::AsExpression<Date> for
            &'__expr NaiveDate {
            type Expression =
                diesel::internal::derives::as_expression::Bound<Date, Self>;
            fn as_expression(self)
                ->
                    <Self as
                    diesel::expression::AsExpression<Date>>::Expression {
                diesel::internal::derives::as_expression::Bound::new(self)
            }
        }
        impl<'__expr>
            diesel::expression::AsExpression<diesel::sql_types::Nullable<Date>>
            for &'__expr NaiveDate {
            type Expression =
                diesel::internal::derives::as_expression::Bound<diesel::sql_types::Nullable<Date>,
                Self>;
            fn as_expression(self)
                ->
                    <Self as
                    diesel::expression::AsExpression<diesel::sql_types::Nullable<Date>>>::Expression {
                diesel::internal::derives::as_expression::Bound::new(self)
            }
        }
        impl<'__expr, '__expr2> diesel::expression::AsExpression<Date> for
            &'__expr2 &'__expr NaiveDate {
            type Expression =
                diesel::internal::derives::as_expression::Bound<Date, Self>;
            fn as_expression(self)
                ->
                    <Self as
                    diesel::expression::AsExpression<Date>>::Expression {
                diesel::internal::derives::as_expression::Bound::new(self)
            }
        }
        impl<'__expr, '__expr2>
            diesel::expression::AsExpression<diesel::sql_types::Nullable<Date>>
            for &'__expr2 &'__expr NaiveDate {
            type Expression =
                diesel::internal::derives::as_expression::Bound<diesel::sql_types::Nullable<Date>,
                Self>;
            fn as_expression(self)
                ->
                    <Self as
                    diesel::expression::AsExpression<diesel::sql_types::Nullable<Date>>>::Expression {
                diesel::internal::derives::as_expression::Bound::new(self)
            }
        }
        impl<__DB>
            diesel::serialize::ToSql<diesel::sql_types::Nullable<Date>, __DB>
            for NaiveDate where __DB: diesel::backend::Backend,
            Self: diesel::serialize::ToSql<Date, __DB> {
            fn to_sql<'__b>(&'__b self,
                out: &mut diesel::serialize::Output<'__b, '_, __DB>)
                -> diesel::serialize::Result {
                diesel::serialize::ToSql::<Date, __DB>::to_sql(self, out)
            }
        }
        impl diesel::expression::AsExpression<Date> for NaiveDate {
            type Expression =
                diesel::internal::derives::as_expression::Bound<Date, Self>;
            fn as_expression(self)
                ->
                    <Self as
                    diesel::expression::AsExpression<Date>>::Expression {
                diesel::internal::derives::as_expression::Bound::new(self)
            }
        }
        impl diesel::expression::AsExpression<diesel::sql_types::Nullable<Date>>
            for NaiveDate {
            type Expression =
                diesel::internal::derives::as_expression::Bound<diesel::sql_types::Nullable<Date>,
                Self>;
            fn as_expression(self)
                ->
                    <Self as
                    diesel::expression::AsExpression<diesel::sql_types::Nullable<Date>>>::Expression {
                diesel::internal::derives::as_expression::Bound::new(self)
            }
        }
    };AsExpression, const _: () =
    {
        use diesel;
        impl<__DB, __ST> diesel::deserialize::Queryable<__ST, __DB> for
            NaiveDate where __DB: diesel::backend::Backend,
            __ST: diesel::sql_types::SingleValue,
            Self: diesel::deserialize::FromSql<__ST, __DB> {
            type Row = Self;
            fn build(row: Self) -> diesel::deserialize::Result<Self> {
                diesel::deserialize::Result::Ok(row)
            }
        }
    };FromSqlRow)]
70    #[diesel(foreign_derive)]
71    #[diesel(sql_type = Date)]
72    struct NaiveDateProxy(NaiveDate);
73
74    #[derive(const _: () =
    {
        use diesel;
        impl<'__expr> diesel::expression::AsExpression<Time> for
            &'__expr NaiveTime {
            type Expression =
                diesel::internal::derives::as_expression::Bound<Time, Self>;
            fn as_expression(self)
                ->
                    <Self as
                    diesel::expression::AsExpression<Time>>::Expression {
                diesel::internal::derives::as_expression::Bound::new(self)
            }
        }
        impl<'__expr>
            diesel::expression::AsExpression<diesel::sql_types::Nullable<Time>>
            for &'__expr NaiveTime {
            type Expression =
                diesel::internal::derives::as_expression::Bound<diesel::sql_types::Nullable<Time>,
                Self>;
            fn as_expression(self)
                ->
                    <Self as
                    diesel::expression::AsExpression<diesel::sql_types::Nullable<Time>>>::Expression {
                diesel::internal::derives::as_expression::Bound::new(self)
            }
        }
        impl<'__expr, '__expr2> diesel::expression::AsExpression<Time> for
            &'__expr2 &'__expr NaiveTime {
            type Expression =
                diesel::internal::derives::as_expression::Bound<Time, Self>;
            fn as_expression(self)
                ->
                    <Self as
                    diesel::expression::AsExpression<Time>>::Expression {
                diesel::internal::derives::as_expression::Bound::new(self)
            }
        }
        impl<'__expr, '__expr2>
            diesel::expression::AsExpression<diesel::sql_types::Nullable<Time>>
            for &'__expr2 &'__expr NaiveTime {
            type Expression =
                diesel::internal::derives::as_expression::Bound<diesel::sql_types::Nullable<Time>,
                Self>;
            fn as_expression(self)
                ->
                    <Self as
                    diesel::expression::AsExpression<diesel::sql_types::Nullable<Time>>>::Expression {
                diesel::internal::derives::as_expression::Bound::new(self)
            }
        }
        impl<__DB>
            diesel::serialize::ToSql<diesel::sql_types::Nullable<Time>, __DB>
            for NaiveTime where __DB: diesel::backend::Backend,
            Self: diesel::serialize::ToSql<Time, __DB> {
            fn to_sql<'__b>(&'__b self,
                out: &mut diesel::serialize::Output<'__b, '_, __DB>)
                -> diesel::serialize::Result {
                diesel::serialize::ToSql::<Time, __DB>::to_sql(self, out)
            }
        }
        impl diesel::expression::AsExpression<Time> for NaiveTime {
            type Expression =
                diesel::internal::derives::as_expression::Bound<Time, Self>;
            fn as_expression(self)
                ->
                    <Self as
                    diesel::expression::AsExpression<Time>>::Expression {
                diesel::internal::derives::as_expression::Bound::new(self)
            }
        }
        impl diesel::expression::AsExpression<diesel::sql_types::Nullable<Time>>
            for NaiveTime {
            type Expression =
                diesel::internal::derives::as_expression::Bound<diesel::sql_types::Nullable<Time>,
                Self>;
            fn as_expression(self)
                ->
                    <Self as
                    diesel::expression::AsExpression<diesel::sql_types::Nullable<Time>>>::Expression {
                diesel::internal::derives::as_expression::Bound::new(self)
            }
        }
    };AsExpression, const _: () =
    {
        use diesel;
        impl<__DB, __ST> diesel::deserialize::Queryable<__ST, __DB> for
            NaiveTime where __DB: diesel::backend::Backend,
            __ST: diesel::sql_types::SingleValue,
            Self: diesel::deserialize::FromSql<__ST, __DB> {
            type Row = Self;
            fn build(row: Self) -> diesel::deserialize::Result<Self> {
                diesel::deserialize::Result::Ok(row)
            }
        }
    };FromSqlRow)]
75    #[diesel(foreign_derive)]
76    #[diesel(sql_type = Time)]
77    struct NaiveTimeProxy(NaiveTime);
78
79    #[derive(const _: () =
    {
        use diesel;
        impl<'__expr> diesel::expression::AsExpression<Timestamp> for
            &'__expr PrimitiveDateTime {
            type Expression =
                diesel::internal::derives::as_expression::Bound<Timestamp,
                Self>;
            fn as_expression(self)
                ->
                    <Self as
                    diesel::expression::AsExpression<Timestamp>>::Expression {
                diesel::internal::derives::as_expression::Bound::new(self)
            }
        }
        impl<'__expr>
            diesel::expression::AsExpression<diesel::sql_types::Nullable<Timestamp>>
            for &'__expr PrimitiveDateTime {
            type Expression =
                diesel::internal::derives::as_expression::Bound<diesel::sql_types::Nullable<Timestamp>,
                Self>;
            fn as_expression(self)
                ->
                    <Self as
                    diesel::expression::AsExpression<diesel::sql_types::Nullable<Timestamp>>>::Expression {
                diesel::internal::derives::as_expression::Bound::new(self)
            }
        }
        impl<'__expr, '__expr2> diesel::expression::AsExpression<Timestamp>
            for &'__expr2 &'__expr PrimitiveDateTime {
            type Expression =
                diesel::internal::derives::as_expression::Bound<Timestamp,
                Self>;
            fn as_expression(self)
                ->
                    <Self as
                    diesel::expression::AsExpression<Timestamp>>::Expression {
                diesel::internal::derives::as_expression::Bound::new(self)
            }
        }
        impl<'__expr, '__expr2>
            diesel::expression::AsExpression<diesel::sql_types::Nullable<Timestamp>>
            for &'__expr2 &'__expr PrimitiveDateTime {
            type Expression =
                diesel::internal::derives::as_expression::Bound<diesel::sql_types::Nullable<Timestamp>,
                Self>;
            fn as_expression(self)
                ->
                    <Self as
                    diesel::expression::AsExpression<diesel::sql_types::Nullable<Timestamp>>>::Expression {
                diesel::internal::derives::as_expression::Bound::new(self)
            }
        }
        impl<__DB>
            diesel::serialize::ToSql<diesel::sql_types::Nullable<Timestamp>,
            __DB> for PrimitiveDateTime where __DB: diesel::backend::Backend,
            Self: diesel::serialize::ToSql<Timestamp, __DB> {
            fn to_sql<'__b>(&'__b self,
                out: &mut diesel::serialize::Output<'__b, '_, __DB>)
                -> diesel::serialize::Result {
                diesel::serialize::ToSql::<Timestamp, __DB>::to_sql(self, out)
            }
        }
        impl diesel::expression::AsExpression<Timestamp> for PrimitiveDateTime
            {
            type Expression =
                diesel::internal::derives::as_expression::Bound<Timestamp,
                Self>;
            fn as_expression(self)
                ->
                    <Self as
                    diesel::expression::AsExpression<Timestamp>>::Expression {
                diesel::internal::derives::as_expression::Bound::new(self)
            }
        }
        impl diesel::expression::AsExpression<diesel::sql_types::Nullable<Timestamp>>
            for PrimitiveDateTime {
            type Expression =
                diesel::internal::derives::as_expression::Bound<diesel::sql_types::Nullable<Timestamp>,
                Self>;
            fn as_expression(self)
                ->
                    <Self as
                    diesel::expression::AsExpression<diesel::sql_types::Nullable<Timestamp>>>::Expression {
                diesel::internal::derives::as_expression::Bound::new(self)
            }
        }
        impl<'__expr>
            diesel::expression::AsExpression<crate::sql_types::Timestamptz>
            for &'__expr PrimitiveDateTime {
            type Expression =
                diesel::internal::derives::as_expression::Bound<crate::sql_types::Timestamptz,
                Self>;
            fn as_expression(self)
                ->
                    <Self as
                    diesel::expression::AsExpression<crate::sql_types::Timestamptz>>::Expression {
                diesel::internal::derives::as_expression::Bound::new(self)
            }
        }
        impl<'__expr>
            diesel::expression::AsExpression<diesel::sql_types::Nullable<crate::sql_types::Timestamptz>>
            for &'__expr PrimitiveDateTime {
            type Expression =
                diesel::internal::derives::as_expression::Bound<diesel::sql_types::Nullable<crate::sql_types::Timestamptz>,
                Self>;
            fn as_expression(self)
                ->
                    <Self as
                    diesel::expression::AsExpression<diesel::sql_types::Nullable<crate::sql_types::Timestamptz>>>::Expression {
                diesel::internal::derives::as_expression::Bound::new(self)
            }
        }
        impl<'__expr, '__expr2>
            diesel::expression::AsExpression<crate::sql_types::Timestamptz>
            for &'__expr2 &'__expr PrimitiveDateTime {
            type Expression =
                diesel::internal::derives::as_expression::Bound<crate::sql_types::Timestamptz,
                Self>;
            fn as_expression(self)
                ->
                    <Self as
                    diesel::expression::AsExpression<crate::sql_types::Timestamptz>>::Expression {
                diesel::internal::derives::as_expression::Bound::new(self)
            }
        }
        impl<'__expr, '__expr2>
            diesel::expression::AsExpression<diesel::sql_types::Nullable<crate::sql_types::Timestamptz>>
            for &'__expr2 &'__expr PrimitiveDateTime {
            type Expression =
                diesel::internal::derives::as_expression::Bound<diesel::sql_types::Nullable<crate::sql_types::Timestamptz>,
                Self>;
            fn as_expression(self)
                ->
                    <Self as
                    diesel::expression::AsExpression<diesel::sql_types::Nullable<crate::sql_types::Timestamptz>>>::Expression {
                diesel::internal::derives::as_expression::Bound::new(self)
            }
        }
        impl<__DB>
            diesel::serialize::ToSql<diesel::sql_types::Nullable<crate::sql_types::Timestamptz>,
            __DB> for PrimitiveDateTime where __DB: diesel::backend::Backend,
            Self: diesel::serialize::ToSql<crate::sql_types::Timestamptz,
            __DB> {
            fn to_sql<'__b>(&'__b self,
                out: &mut diesel::serialize::Output<'__b, '_, __DB>)
                -> diesel::serialize::Result {
                diesel::serialize::ToSql::<crate::sql_types::Timestamptz,
                        __DB>::to_sql(self, out)
            }
        }
        impl diesel::expression::AsExpression<crate::sql_types::Timestamptz>
            for PrimitiveDateTime {
            type Expression =
                diesel::internal::derives::as_expression::Bound<crate::sql_types::Timestamptz,
                Self>;
            fn as_expression(self)
                ->
                    <Self as
                    diesel::expression::AsExpression<crate::sql_types::Timestamptz>>::Expression {
                diesel::internal::derives::as_expression::Bound::new(self)
            }
        }
        impl diesel::expression::AsExpression<diesel::sql_types::Nullable<crate::sql_types::Timestamptz>>
            for PrimitiveDateTime {
            type Expression =
                diesel::internal::derives::as_expression::Bound<diesel::sql_types::Nullable<crate::sql_types::Timestamptz>,
                Self>;
            fn as_expression(self)
                ->
                    <Self as
                    diesel::expression::AsExpression<diesel::sql_types::Nullable<crate::sql_types::Timestamptz>>>::Expression {
                diesel::internal::derives::as_expression::Bound::new(self)
            }
        }
        impl<'__expr>
            diesel::expression::AsExpression<crate::sql_types::Datetime> for
            &'__expr PrimitiveDateTime {
            type Expression =
                diesel::internal::derives::as_expression::Bound<crate::sql_types::Datetime,
                Self>;
            fn as_expression(self)
                ->
                    <Self as
                    diesel::expression::AsExpression<crate::sql_types::Datetime>>::Expression {
                diesel::internal::derives::as_expression::Bound::new(self)
            }
        }
        impl<'__expr>
            diesel::expression::AsExpression<diesel::sql_types::Nullable<crate::sql_types::Datetime>>
            for &'__expr PrimitiveDateTime {
            type Expression =
                diesel::internal::derives::as_expression::Bound<diesel::sql_types::Nullable<crate::sql_types::Datetime>,
                Self>;
            fn as_expression(self)
                ->
                    <Self as
                    diesel::expression::AsExpression<diesel::sql_types::Nullable<crate::sql_types::Datetime>>>::Expression {
                diesel::internal::derives::as_expression::Bound::new(self)
            }
        }
        impl<'__expr, '__expr2>
            diesel::expression::AsExpression<crate::sql_types::Datetime> for
            &'__expr2 &'__expr PrimitiveDateTime {
            type Expression =
                diesel::internal::derives::as_expression::Bound<crate::sql_types::Datetime,
                Self>;
            fn as_expression(self)
                ->
                    <Self as
                    diesel::expression::AsExpression<crate::sql_types::Datetime>>::Expression {
                diesel::internal::derives::as_expression::Bound::new(self)
            }
        }
        impl<'__expr, '__expr2>
            diesel::expression::AsExpression<diesel::sql_types::Nullable<crate::sql_types::Datetime>>
            for &'__expr2 &'__expr PrimitiveDateTime {
            type Expression =
                diesel::internal::derives::as_expression::Bound<diesel::sql_types::Nullable<crate::sql_types::Datetime>,
                Self>;
            fn as_expression(self)
                ->
                    <Self as
                    diesel::expression::AsExpression<diesel::sql_types::Nullable<crate::sql_types::Datetime>>>::Expression {
                diesel::internal::derives::as_expression::Bound::new(self)
            }
        }
        impl<__DB>
            diesel::serialize::ToSql<diesel::sql_types::Nullable<crate::sql_types::Datetime>,
            __DB> for PrimitiveDateTime where __DB: diesel::backend::Backend,
            Self: diesel::serialize::ToSql<crate::sql_types::Datetime, __DB> {
            fn to_sql<'__b>(&'__b self,
                out: &mut diesel::serialize::Output<'__b, '_, __DB>)
                -> diesel::serialize::Result {
                diesel::serialize::ToSql::<crate::sql_types::Datetime,
                        __DB>::to_sql(self, out)
            }
        }
        impl diesel::expression::AsExpression<crate::sql_types::Datetime> for
            PrimitiveDateTime {
            type Expression =
                diesel::internal::derives::as_expression::Bound<crate::sql_types::Datetime,
                Self>;
            fn as_expression(self)
                ->
                    <Self as
                    diesel::expression::AsExpression<crate::sql_types::Datetime>>::Expression {
                diesel::internal::derives::as_expression::Bound::new(self)
            }
        }
        impl diesel::expression::AsExpression<diesel::sql_types::Nullable<crate::sql_types::Datetime>>
            for PrimitiveDateTime {
            type Expression =
                diesel::internal::derives::as_expression::Bound<diesel::sql_types::Nullable<crate::sql_types::Datetime>,
                Self>;
            fn as_expression(self)
                ->
                    <Self as
                    diesel::expression::AsExpression<diesel::sql_types::Nullable<crate::sql_types::Datetime>>>::Expression {
                diesel::internal::derives::as_expression::Bound::new(self)
            }
        }
    };AsExpression, const _: () =
    {
        use diesel;
        impl<__DB, __ST> diesel::deserialize::Queryable<__ST, __DB> for
            PrimitiveDateTime where __DB: diesel::backend::Backend,
            __ST: diesel::sql_types::SingleValue,
            Self: diesel::deserialize::FromSql<__ST, __DB> {
            type Row = Self;
            fn build(row: Self) -> diesel::deserialize::Result<Self> {
                diesel::deserialize::Result::Ok(row)
            }
        }
    };FromSqlRow)]
80    #[diesel(foreign_derive)]
81    #[diesel(sql_type = Timestamp)]
82    #[cfg_attr(
83        feature = "postgres_backend",
84        diesel(sql_type = crate::sql_types::Timestamptz)
85    )]
86    #[cfg_attr(feature = "mysql_backend", diesel(sql_type = crate::sql_types::Datetime))]
87    struct NaiveDateTimeProxy(PrimitiveDateTime);
88
89    #[derive(const _: () =
    {
        use diesel;
        impl<__DB, __ST> diesel::deserialize::Queryable<__ST, __DB> for
            OffsetDateTime where __DB: diesel::backend::Backend,
            __ST: diesel::sql_types::SingleValue,
            Self: diesel::deserialize::FromSql<__ST, __DB> {
            type Row = Self;
            fn build(row: Self) -> diesel::deserialize::Result<Self> {
                diesel::deserialize::Result::Ok(row)
            }
        }
    };FromSqlRow)]
90    #[diesel(foreign_derive)]
91    #[cfg_attr(
92        any(
93            feature = "postgres_backend",
94            feature = "__sqlite-shared",
95            feature = "mysql_backend"
96        ),
97        derive(const _: () =
    {
        use diesel;
        impl<'__expr>
            diesel::expression::AsExpression<crate::sql_types::Timestamptz>
            for &'__expr OffsetDateTime {
            type Expression =
                diesel::internal::derives::as_expression::Bound<crate::sql_types::Timestamptz,
                Self>;
            fn as_expression(self)
                ->
                    <Self as
                    diesel::expression::AsExpression<crate::sql_types::Timestamptz>>::Expression {
                diesel::internal::derives::as_expression::Bound::new(self)
            }
        }
        impl<'__expr>
            diesel::expression::AsExpression<diesel::sql_types::Nullable<crate::sql_types::Timestamptz>>
            for &'__expr OffsetDateTime {
            type Expression =
                diesel::internal::derives::as_expression::Bound<diesel::sql_types::Nullable<crate::sql_types::Timestamptz>,
                Self>;
            fn as_expression(self)
                ->
                    <Self as
                    diesel::expression::AsExpression<diesel::sql_types::Nullable<crate::sql_types::Timestamptz>>>::Expression {
                diesel::internal::derives::as_expression::Bound::new(self)
            }
        }
        impl<'__expr, '__expr2>
            diesel::expression::AsExpression<crate::sql_types::Timestamptz>
            for &'__expr2 &'__expr OffsetDateTime {
            type Expression =
                diesel::internal::derives::as_expression::Bound<crate::sql_types::Timestamptz,
                Self>;
            fn as_expression(self)
                ->
                    <Self as
                    diesel::expression::AsExpression<crate::sql_types::Timestamptz>>::Expression {
                diesel::internal::derives::as_expression::Bound::new(self)
            }
        }
        impl<'__expr, '__expr2>
            diesel::expression::AsExpression<diesel::sql_types::Nullable<crate::sql_types::Timestamptz>>
            for &'__expr2 &'__expr OffsetDateTime {
            type Expression =
                diesel::internal::derives::as_expression::Bound<diesel::sql_types::Nullable<crate::sql_types::Timestamptz>,
                Self>;
            fn as_expression(self)
                ->
                    <Self as
                    diesel::expression::AsExpression<diesel::sql_types::Nullable<crate::sql_types::Timestamptz>>>::Expression {
                diesel::internal::derives::as_expression::Bound::new(self)
            }
        }
        impl<__DB>
            diesel::serialize::ToSql<diesel::sql_types::Nullable<crate::sql_types::Timestamptz>,
            __DB> for OffsetDateTime where __DB: diesel::backend::Backend,
            Self: diesel::serialize::ToSql<crate::sql_types::Timestamptz,
            __DB> {
            fn to_sql<'__b>(&'__b self,
                out: &mut diesel::serialize::Output<'__b, '_, __DB>)
                -> diesel::serialize::Result {
                diesel::serialize::ToSql::<crate::sql_types::Timestamptz,
                        __DB>::to_sql(self, out)
            }
        }
        impl diesel::expression::AsExpression<crate::sql_types::Timestamptz>
            for OffsetDateTime {
            type Expression =
                diesel::internal::derives::as_expression::Bound<crate::sql_types::Timestamptz,
                Self>;
            fn as_expression(self)
                ->
                    <Self as
                    diesel::expression::AsExpression<crate::sql_types::Timestamptz>>::Expression {
                diesel::internal::derives::as_expression::Bound::new(self)
            }
        }
        impl diesel::expression::AsExpression<diesel::sql_types::Nullable<crate::sql_types::Timestamptz>>
            for OffsetDateTime {
            type Expression =
                diesel::internal::derives::as_expression::Bound<diesel::sql_types::Nullable<crate::sql_types::Timestamptz>,
                Self>;
            fn as_expression(self)
                ->
                    <Self as
                    diesel::expression::AsExpression<diesel::sql_types::Nullable<crate::sql_types::Timestamptz>>>::Expression {
                diesel::internal::derives::as_expression::Bound::new(self)
            }
        }
        impl<'__expr>
            diesel::expression::AsExpression<crate::sql_types::TimestamptzSqlite>
            for &'__expr OffsetDateTime {
            type Expression =
                diesel::internal::derives::as_expression::Bound<crate::sql_types::TimestamptzSqlite,
                Self>;
            fn as_expression(self)
                ->
                    <Self as
                    diesel::expression::AsExpression<crate::sql_types::TimestamptzSqlite>>::Expression {
                diesel::internal::derives::as_expression::Bound::new(self)
            }
        }
        impl<'__expr>
            diesel::expression::AsExpression<diesel::sql_types::Nullable<crate::sql_types::TimestamptzSqlite>>
            for &'__expr OffsetDateTime {
            type Expression =
                diesel::internal::derives::as_expression::Bound<diesel::sql_types::Nullable<crate::sql_types::TimestamptzSqlite>,
                Self>;
            fn as_expression(self)
                ->
                    <Self as
                    diesel::expression::AsExpression<diesel::sql_types::Nullable<crate::sql_types::TimestamptzSqlite>>>::Expression {
                diesel::internal::derives::as_expression::Bound::new(self)
            }
        }
        impl<'__expr, '__expr2>
            diesel::expression::AsExpression<crate::sql_types::TimestamptzSqlite>
            for &'__expr2 &'__expr OffsetDateTime {
            type Expression =
                diesel::internal::derives::as_expression::Bound<crate::sql_types::TimestamptzSqlite,
                Self>;
            fn as_expression(self)
                ->
                    <Self as
                    diesel::expression::AsExpression<crate::sql_types::TimestamptzSqlite>>::Expression {
                diesel::internal::derives::as_expression::Bound::new(self)
            }
        }
        impl<'__expr, '__expr2>
            diesel::expression::AsExpression<diesel::sql_types::Nullable<crate::sql_types::TimestamptzSqlite>>
            for &'__expr2 &'__expr OffsetDateTime {
            type Expression =
                diesel::internal::derives::as_expression::Bound<diesel::sql_types::Nullable<crate::sql_types::TimestamptzSqlite>,
                Self>;
            fn as_expression(self)
                ->
                    <Self as
                    diesel::expression::AsExpression<diesel::sql_types::Nullable<crate::sql_types::TimestamptzSqlite>>>::Expression {
                diesel::internal::derives::as_expression::Bound::new(self)
            }
        }
        impl<__DB>
            diesel::serialize::ToSql<diesel::sql_types::Nullable<crate::sql_types::TimestamptzSqlite>,
            __DB> for OffsetDateTime where __DB: diesel::backend::Backend,
            Self: diesel::serialize::ToSql<crate::sql_types::TimestamptzSqlite,
            __DB> {
            fn to_sql<'__b>(&'__b self,
                out: &mut diesel::serialize::Output<'__b, '_, __DB>)
                -> diesel::serialize::Result {
                diesel::serialize::ToSql::<crate::sql_types::TimestamptzSqlite,
                        __DB>::to_sql(self, out)
            }
        }
        impl diesel::expression::AsExpression<crate::sql_types::TimestamptzSqlite>
            for OffsetDateTime {
            type Expression =
                diesel::internal::derives::as_expression::Bound<crate::sql_types::TimestamptzSqlite,
                Self>;
            fn as_expression(self)
                ->
                    <Self as
                    diesel::expression::AsExpression<crate::sql_types::TimestamptzSqlite>>::Expression {
                diesel::internal::derives::as_expression::Bound::new(self)
            }
        }
        impl diesel::expression::AsExpression<diesel::sql_types::Nullable<crate::sql_types::TimestamptzSqlite>>
            for OffsetDateTime {
            type Expression =
                diesel::internal::derives::as_expression::Bound<diesel::sql_types::Nullable<crate::sql_types::TimestamptzSqlite>,
                Self>;
            fn as_expression(self)
                ->
                    <Self as
                    diesel::expression::AsExpression<diesel::sql_types::Nullable<crate::sql_types::TimestamptzSqlite>>>::Expression {
                diesel::internal::derives::as_expression::Bound::new(self)
            }
        }
        impl<'__expr>
            diesel::expression::AsExpression<crate::sql_types::Datetime> for
            &'__expr OffsetDateTime {
            type Expression =
                diesel::internal::derives::as_expression::Bound<crate::sql_types::Datetime,
                Self>;
            fn as_expression(self)
                ->
                    <Self as
                    diesel::expression::AsExpression<crate::sql_types::Datetime>>::Expression {
                diesel::internal::derives::as_expression::Bound::new(self)
            }
        }
        impl<'__expr>
            diesel::expression::AsExpression<diesel::sql_types::Nullable<crate::sql_types::Datetime>>
            for &'__expr OffsetDateTime {
            type Expression =
                diesel::internal::derives::as_expression::Bound<diesel::sql_types::Nullable<crate::sql_types::Datetime>,
                Self>;
            fn as_expression(self)
                ->
                    <Self as
                    diesel::expression::AsExpression<diesel::sql_types::Nullable<crate::sql_types::Datetime>>>::Expression {
                diesel::internal::derives::as_expression::Bound::new(self)
            }
        }
        impl<'__expr, '__expr2>
            diesel::expression::AsExpression<crate::sql_types::Datetime> for
            &'__expr2 &'__expr OffsetDateTime {
            type Expression =
                diesel::internal::derives::as_expression::Bound<crate::sql_types::Datetime,
                Self>;
            fn as_expression(self)
                ->
                    <Self as
                    diesel::expression::AsExpression<crate::sql_types::Datetime>>::Expression {
                diesel::internal::derives::as_expression::Bound::new(self)
            }
        }
        impl<'__expr, '__expr2>
            diesel::expression::AsExpression<diesel::sql_types::Nullable<crate::sql_types::Datetime>>
            for &'__expr2 &'__expr OffsetDateTime {
            type Expression =
                diesel::internal::derives::as_expression::Bound<diesel::sql_types::Nullable<crate::sql_types::Datetime>,
                Self>;
            fn as_expression(self)
                ->
                    <Self as
                    diesel::expression::AsExpression<diesel::sql_types::Nullable<crate::sql_types::Datetime>>>::Expression {
                diesel::internal::derives::as_expression::Bound::new(self)
            }
        }
        impl<__DB>
            diesel::serialize::ToSql<diesel::sql_types::Nullable<crate::sql_types::Datetime>,
            __DB> for OffsetDateTime where __DB: diesel::backend::Backend,
            Self: diesel::serialize::ToSql<crate::sql_types::Datetime, __DB> {
            fn to_sql<'__b>(&'__b self,
                out: &mut diesel::serialize::Output<'__b, '_, __DB>)
                -> diesel::serialize::Result {
                diesel::serialize::ToSql::<crate::sql_types::Datetime,
                        __DB>::to_sql(self, out)
            }
        }
        impl diesel::expression::AsExpression<crate::sql_types::Datetime> for
            OffsetDateTime {
            type Expression =
                diesel::internal::derives::as_expression::Bound<crate::sql_types::Datetime,
                Self>;
            fn as_expression(self)
                ->
                    <Self as
                    diesel::expression::AsExpression<crate::sql_types::Datetime>>::Expression {
                diesel::internal::derives::as_expression::Bound::new(self)
            }
        }
        impl diesel::expression::AsExpression<diesel::sql_types::Nullable<crate::sql_types::Datetime>>
            for OffsetDateTime {
            type Expression =
                diesel::internal::derives::as_expression::Bound<diesel::sql_types::Nullable<crate::sql_types::Datetime>,
                Self>;
            fn as_expression(self)
                ->
                    <Self as
                    diesel::expression::AsExpression<diesel::sql_types::Nullable<crate::sql_types::Datetime>>>::Expression {
                diesel::internal::derives::as_expression::Bound::new(self)
            }
        }
    };AsExpression)
98    )]
99    #[cfg_attr(
100        feature = "postgres_backend",
101        diesel(sql_type = crate::sql_types::Timestamptz)
102    )]
103    #[cfg_attr(feature = "__sqlite-shared", diesel(sql_type = crate::sql_types::TimestamptzSqlite))]
104    #[cfg_attr(feature = "mysql_backend", diesel(sql_type = crate::sql_types::Datetime))]
105    struct DateTimeProxy(OffsetDateTime);
106}