pub struct SetQuery { /* private fields */ }Expand description
Set operation query, supports chaining multiple SELECTs joined by UNION/INTERSECT/EXCEPT.
§Example
ⓘ
use sz_orm_core::DbType;
use sz_orm_query_builder::Query;
let q1 = Query::select().column("id").from("active_users");
let q2 = Query::select().column("id").from("pending_users");
let sql = q1.union(q2).build(DbType::MySQL);
// SELECT `id` FROM `active_users` UNION SELECT `id` FROM `pending_users`Implementations§
Source§impl SetQuery
impl SetQuery
Sourcepub fn new(first: SelectQuery, op: SetOperator, second: SelectQuery) -> Self
pub fn new(first: SelectQuery, op: SetOperator, second: SelectQuery) -> Self
Create a set operation query.
Sourcepub fn union(self, other: SelectQuery) -> Self
pub fn union(self, other: SelectQuery) -> Self
Append a UNION query.
Sourcepub fn union_all(self, other: SelectQuery) -> Self
pub fn union_all(self, other: SelectQuery) -> Self
Append a UNION ALL query.
Sourcepub fn intersect(self, other: SelectQuery) -> Self
pub fn intersect(self, other: SelectQuery) -> Self
Append an INTERSECT query.
Sourcepub fn except(self, other: SelectQuery) -> Self
pub fn except(self, other: SelectQuery) -> Self
Append an EXCEPT query.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for SetQuery
impl RefUnwindSafe for SetQuery
impl Send for SetQuery
impl Sync for SetQuery
impl Unpin for SetQuery
impl UnsafeUnpin for SetQuery
impl UnwindSafe for SetQuery
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more