Trait diesel::expression_methods::text_expression_methods::TextExpressionMethods
[−]
[src]
pub trait TextExpressionMethods: Expression<SqlType = Text> + Sized { fn concat<T: AsExpression<Text>>(
self,
other: T
) -> Concat<Self, T::Expression> { ... } fn like<T: AsExpression<Text>>(self, other: T) -> Like<Self, T::Expression> { ... } fn not_like<T: AsExpression<Text>>(
self,
other: T
) -> NotLike<Self, T::Expression> { ... } }
Provided Methods
fn concat<T: AsExpression<Text>>(self, other: T) -> Concat<Self, T::Expression>
Concatenates two strings using the ||
operator.
Example
let names = users.select(name.concat(" the Greatest")).load(&connection); let expected_names = vec![ "Sean the Greatest".to_string(), "Tess the Greatest".to_string(), ]; assert_eq!(Ok(expected_names), names);
fn like<T: AsExpression<Text>>(self, other: T) -> Like<Self, T::Expression>
Returns a SQL LIKE
expression
fn not_like<T: AsExpression<Text>>(
self,
other: T
) -> NotLike<Self, T::Expression>
self,
other: T
) -> NotLike<Self, T::Expression>
Returns a SQL NOT LIKE
expression
Implementors
impl<T: Expression<SqlType = Text>> TextExpressionMethods for T