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) + } + } } }