Function diesel::dsl::exists[][src]

pub fn exists<T>(query: T) -> Exists<T>
Expand description

Creates a SQL EXISTS expression.

The argument must be a complete SQL query. The query may reference columns from the outer table.

Example

let sean_exists = select(exists(users.filter(name.eq("Sean"))))
    .get_result(&connection);
let jim_exists = select(exists(users.filter(name.eq("Jim"))))
    .get_result(&connection);
assert_eq!(Ok(true), sean_exists);
assert_eq!(Ok(false), jim_exists);