Add missing Diesel implementations.

This commit is contained in:
Jimmy Cuadra 2017-02-08 22:25:01 -08:00
parent 29f76ca95d
commit e4c3cae7fd

View File

@ -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<Nullable<Text>> for $crate::$name {
type Expression = Bound<Nullable<Text>, Self>;
fn as_expression(self) -> Self::Expression {
Bound::new(self)
}
}
impl<'a> AsExpression<Nullable<Text>> for &'a $crate::$name {
type Expression = Bound<Nullable<Text>, Self>;
fn as_expression(self) -> Self::Expression {
Bound::new(self)
}
}
}
}