toasty_core/stmt/
expr_exists.rs1use crate::stmt::{Expr, Query};
2
3#[derive(Debug, Clone, PartialEq)]
14pub struct ExprExists {
15 pub subquery: Box<Query>,
17}
18
19impl Expr {
20 pub fn exists(subquery: impl Into<Query>) -> Expr {
21 Expr::Exists(ExprExists {
22 subquery: Box::new(subquery.into()),
23 })
24 }
25
26 pub fn not_exists(subquery: impl Into<Query>) -> Expr {
27 Expr::not(Expr::exists(subquery))
28 }
29}
30
31impl From<ExprExists> for Expr {
32 fn from(value: ExprExists) -> Self {
33 Self::Exists(value)
34 }
35}