Trait diesel::expression_methods::PgTextExpressionMethods [] [src]

pub trait PgTextExpressionMethods: Expression<SqlType = Text> + Sized {
    fn ilike<T: AsExpression<Text>>(
        self,
        other: T
    ) -> ILike<Self, T::Expression> { ... }
fn not_ilike<T: AsExpression<Text>>(
        self,
        other: T
    ) -> NotILike<Self, T::Expression> { ... } }

PostgreSQL specific methods present on text expressions.

Provided Methods

Creates a PostgreSQL ILIKE expression

Example

let starts_with_s = users
    .select(name)
    .filter(name.ilike("s%"))
    .get_results::<String>(&connection)?;
assert_eq!(vec!["Sean"], starts_with_s);

Creates a PostgreSQL NOT ILIKE expression

Example

let doesnt_start_with_s = users
    .select(name)
    .filter(name.not_ilike("s%"))
    .get_results::<String>(&connection)?;
assert_eq!(vec!["Tess"], doesnt_start_with_s);

Implementors