toasty_core/stmt/
expr_set_op.rs

1use super::{ExprSet, SetOp};
2
3/// A set operation combining multiple queries.
4///
5/// Applies a set operator (union, except, intersect) to combine the results of
6/// multiple queries into a single result set.
7///
8/// # Examples
9///
10/// ```text
11/// SELECT ... UNION SELECT ...       // combines with union
12/// SELECT ... EXCEPT SELECT ...      // removes matching rows
13/// SELECT ... INTERSECT SELECT ...   // keeps only common rows
14/// ```
15#[derive(Debug, Clone, PartialEq)]
16pub struct ExprSetOp {
17    /// The set operation to apply.
18    pub op: SetOp,
19
20    /// The queries to combine.
21    pub operands: Vec<ExprSet>,
22}
23
24impl ExprSetOp {
25    pub fn is_union(&self) -> bool {
26        matches!(self.op, SetOp::Union)
27    }
28}