pub struct SelectTwo<E: EntityTrait, R: EntityTrait> { /* private fields */ }Expand description
A SELECT of an entity together with an optional related row.
Implementations§
Source§impl<E: EntityTrait, R: EntityTrait> SelectTwo<E, R>
impl<E: EntityTrait, R: EntityTrait> SelectTwo<E, R>
Sourcepub fn filter(self, cond: impl IntoCondition) -> Self
pub fn filter(self, cond: impl IntoCondition) -> Self
Adds a WHERE condition, ANDed with the previous ones.
Sourcepub fn order_by(self, column: E::Column, order: Order) -> Self
pub fn order_by(self, column: E::Column, order: Order) -> Self
Adds ORDER BY a column of E in the given direction.
Adds ORDER BY a column of R in the given direction.
The column is qualified by R’s table name, which is right unless
R was joined under an alias; then use
order_by_expr with Expr::col((alias, column)).
Sourcepub fn order_by_expr(self, expr: Expr, order: Order) -> Self
pub fn order_by_expr(self, expr: Expr, order: Order) -> Self
Adds ORDER BY expr in the given direction.
Sourcepub fn query_mut(&mut self) -> &mut Select
pub fn query_mut(&mut self) -> &mut Select
Mutable access to the underlying SQL builder, for clauses this API does not expose.
Trait Implementations§
Source§impl<E: Clone + EntityTrait, R: Clone + EntityTrait> Clone for SelectTwo<E, R>
impl<E: Clone + EntityTrait, R: Clone + EntityTrait> Clone for SelectTwo<E, R>
Auto Trait Implementations§
impl<E, R> Freeze for SelectTwo<E, R>
impl<E, R> RefUnwindSafe for SelectTwo<E, R>
impl<E, R> Send for SelectTwo<E, R>
impl<E, R> Sync for SelectTwo<E, R>
impl<E, R> Unpin for SelectTwo<E, R>
impl<E, R> UnsafeUnpin for SelectTwo<E, R>
impl<E, R> UnwindSafe for SelectTwo<E, R>
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,
impl<T> ErasedDestructor for Twhere
T: 'static,
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