Trait block_tools::db::use_diesel::expression_methods::PgTextExpressionMethods [−][src]
PostgreSQL specific methods present on text expressions.
Provided methods
pub fn ilike<T>(
self,
other: T
) -> ILike<Self, <T as AsExpression<Text>>::Expression> where
T: AsExpression<Text>,
[src]
self,
other: T
) -> ILike<Self, <T as AsExpression<Text>>::Expression> where
T: AsExpression<Text>,
Creates a PostgreSQL ILIKE
expression
Example
let starts_with_s = animals .select(species) .filter(name.ilike("s%").or(species.ilike("s%"))) .get_results::<String>(&connection)?; assert_eq!(vec!["spider"], starts_with_s);
pub fn not_ilike<T>(
self,
other: T
) -> NotILike<Self, <T as AsExpression<Text>>::Expression> where
T: AsExpression<Text>,
[src]
self,
other: T
) -> NotILike<Self, <T as AsExpression<Text>>::Expression> where
T: AsExpression<Text>,
Creates a PostgreSQL NOT ILIKE
expression
Example
let doesnt_start_with_s = animals .select(species) .filter(name.not_ilike("s%").and(species.not_ilike("s%"))) .get_results::<String>(&connection)?; assert_eq!(vec!["dog"], doesnt_start_with_s);
Implementors
impl<T> PgTextExpressionMethods for T where
T: Expression,
<T as Expression>::SqlType: TextOrNullableText,
[src]
T: Expression,
<T as Expression>::SqlType: TextOrNullableText,