Add missing Diesel implementations.
This commit is contained in:
parent
29f76ca95d
commit
e4c3cae7fd
18
src/lib.rs
18
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<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)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user