Function diesel::expression::dsl::any [] [src]

pub fn any<ST, T>(vals: T) -> Any<T::Expression, ST> where ST: NativeSqlType, T: AsExpression<Array<ST>>

Creates a PostgreSQL ANY expression.

As with most bare functions, this is not exported by default. You can import it specifically from diesel::expression::any, or glob import diesel::expression::dsl::*

Example

let sean = (1, "Sean".to_string());
let jim = (3, "Jim".to_string());
let data = users.filter(name.eq(any(vec!["Sean", "Jim"])));
assert_eq!(vec![sean, jim], data.load(&connection).unwrap().collect::<Vec<_>>());