pub struct SetOpBuilder { /* private fields */ }Expand description
Fluent builder for UNION, INTERSECT, and EXCEPT set operations.
Created by the free functions union(), union_all(), intersect(),
intersect_all(), except_(), except_all(), or the corresponding methods
on SelectBuilder. Supports optional .order_by(), .limit(), and .offset()
clauses applied to the combined result.
§Examples
use polyglot_sql::builder::*;
let sql = union_all(
select(["id"]).from("a"),
select(["id"]).from("b"),
)
.order_by(["id"])
.limit(10)
.to_sql();Implementations§
Source§impl SetOpBuilder
impl SetOpBuilder
Sourcepub fn order_by<I, E>(self, expressions: I) -> Selfwhere
I: IntoIterator<Item = E>,
E: IntoExpr,
pub fn order_by<I, E>(self, expressions: I) -> Selfwhere
I: IntoIterator<Item = E>,
E: IntoExpr,
Sourcepub fn limit(self, count: usize) -> Self
pub fn limit(self, count: usize) -> Self
Restrict the combined set operation result to count rows.
Sourcepub fn offset(self, count: usize) -> Self
pub fn offset(self, count: usize) -> Self
Skip the first count rows from the combined set operation result.
Sourcepub fn build(self) -> Expression
pub fn build(self) -> Expression
Consume this builder and produce the final set operation Expression AST node.
The returned expression is one of Expression::Union, Expression::Intersect,
or Expression::Except depending on how the builder was created.
Auto Trait Implementations§
impl Freeze for SetOpBuilder
impl RefUnwindSafe for SetOpBuilder
impl Send for SetOpBuilder
impl Sync for SetOpBuilder
impl Unpin for SetOpBuilder
impl UnwindSafe for SetOpBuilder
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more