From e4c3cae7fd9a2a8940f9cab098e674e3480c2a32 Mon Sep 17 00:00:00 2001 From: Jimmy Cuadra Date: Wed, 8 Feb 2017 22:25:01 -0800 Subject: [PATCH] Add missing Diesel implementations. --- src/lib.rs | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/lib.rs b/src/lib.rs index 5b75256c..05e1a1c3 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -684,7 +684,7 @@ mod diesel_integration { use diesel::expression::AsExpression; use diesel::expression::bound::Bound; use diesel::row::Row; - use diesel::types::{FromSql, FromSqlRow, HasSqlType, IsNull, Text, ToSql}; + use diesel::types::{FromSql, FromSqlRow, HasSqlType, IsNull, Nullable, Text, ToSql}; macro_rules! diesel_impl { ($name:ident) => { @@ -741,6 +741,22 @@ mod diesel_integration { Bound::new(self) } } + + impl AsExpression> for $crate::$name { + type Expression = Bound, Self>; + + fn as_expression(self) -> Self::Expression { + Bound::new(self) + } + } + + impl<'a> AsExpression> for &'a $crate::$name { + type Expression = Bound, Self>; + + fn as_expression(self) -> Self::Expression { + Bound::new(self) + } + } } }