pub struct SelectTwoMany<E, F> where
E: EntityTrait,
F: EntityTrait, { /* private fields */ }
Expand description
Defines a structure to perform a SELECT operation on many Models
Implementations
impl<E, F> SelectTwoMany<E, F> where
E: EntityTrait,
F: EntityTrait,
impl<E, F> SelectTwoMany<E, F> where
E: EntityTrait,
F: EntityTrait,
pub fn into_json(self) -> Selector<SelectTwoModel<Value, Value>>
pub fn into_json(self) -> Selector<SelectTwoModel<Value, Value>>
Convert the results to JSON
pub async fn one<'a, C>(
self,
db: &'_ C
) -> Result<Option<(<E as EntityTrait>::Model, Option<<F as EntityTrait>::Model>)>, DbErr> where
C: ConnectionTrait,
pub async fn one<'a, C>(
self,
db: &'_ C
) -> Result<Option<(<E as EntityTrait>::Model, Option<<F as EntityTrait>::Model>)>, DbErr> where
C: ConnectionTrait,
Select one Model
pub async fn stream<'a, 'b, C>(
self,
db: &'a C
) -> Result<impl Stream<Item = Result<(<E as EntityTrait>::Model, Option<<F as EntityTrait>::Model>), DbErr>> + 'b, DbErr> where
'a: 'b,
C: ConnectionTrait + StreamTrait<'a>,
pub async fn stream<'a, 'b, C>(
self,
db: &'a C
) -> Result<impl Stream<Item = Result<(<E as EntityTrait>::Model, Option<<F as EntityTrait>::Model>), DbErr>> + 'b, DbErr> where
'a: 'b,
C: ConnectionTrait + StreamTrait<'a>,
Stream the result of the operation
pub async fn all<'a, C>(
self,
db: &'_ C
) -> Result<Vec<(<E as EntityTrait>::Model, Vec<<F as EntityTrait>::Model, Global>), Global>, DbErr> where
C: ConnectionTrait,
pub async fn all<'a, C>(
self,
db: &'_ C
) -> Result<Vec<(<E as EntityTrait>::Model, Vec<<F as EntityTrait>::Model, Global>), Global>, DbErr> where
C: ConnectionTrait,
Get all Models from the select operation
Trait Implementations
impl<E, F> Clone for SelectTwoMany<E, F> where
E: Clone + EntityTrait,
F: Clone + EntityTrait,
impl<E, F> Clone for SelectTwoMany<E, F> where
E: Clone + EntityTrait,
F: Clone + EntityTrait,
fn clone(&self) -> SelectTwoMany<E, F>
fn clone(&self) -> SelectTwoMany<E, F>
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
impl<E, F> Debug for SelectTwoMany<E, F> where
E: Debug + EntityTrait,
F: Debug + EntityTrait,
impl<E, F> Debug for SelectTwoMany<E, F> where
E: Debug + EntityTrait,
F: Debug + EntityTrait,
impl<E, F> QueryFilter for SelectTwoMany<E, F> where
E: EntityTrait,
F: EntityTrait,
impl<E, F> QueryFilter for SelectTwoMany<E, F> where
E: EntityTrait,
F: EntityTrait,
type QueryStatement = SelectStatement
fn query(&mut self) -> &mut SelectStatement
fn query(&mut self) -> &mut SelectStatement
Add the query to perform a FILTER on
fn filter<F>(self, filter: F) -> Self where
F: IntoCondition,
fn filter<F>(self, filter: F) -> Self where
F: IntoCondition,
Add an AND WHERE expression Read more
fn belongs_to<M>(self, model: &M) -> Self where
M: ModelTrait,
fn belongs_to<M>(self, model: &M) -> Self where
M: ModelTrait,
Apply a where condition using the model’s primary key
fn belongs_to_tbl_alias<M>(self, model: &M, tbl_alias: &str) -> Self where
M: ModelTrait,
fn belongs_to_tbl_alias<M>(self, model: &M, tbl_alias: &str) -> Self where
M: ModelTrait,
Perform a check to determine table belongs to a Model through it’s name alias
impl<E, F> QueryOrder for SelectTwoMany<E, F> where
E: EntityTrait,
F: EntityTrait,
impl<E, F> QueryOrder for SelectTwoMany<E, F> where
E: EntityTrait,
F: EntityTrait,
type QueryStatement = SelectStatement
fn query(&mut self) -> &mut SelectStatement
fn query(&mut self) -> &mut SelectStatement
Add the query to perform an ORDER BY operation
fn order_by<C>(self, col: C, ord: Order) -> Self where
C: IntoSimpleExpr,
fn order_by<C>(self, col: C, ord: Order) -> Self where
C: IntoSimpleExpr,
Add an order_by expression Read more
fn order_by_asc<C>(self, col: C) -> Self where
C: IntoSimpleExpr,
fn order_by_asc<C>(self, col: C) -> Self where
C: IntoSimpleExpr,
Add an order_by expression (ascending) Read more
fn order_by_desc<C>(self, col: C) -> Self where
C: IntoSimpleExpr,
fn order_by_desc<C>(self, col: C) -> Self where
C: IntoSimpleExpr,
Add an order_by expression (descending) Read more
impl<E, F> QuerySelect for SelectTwoMany<E, F> where
E: EntityTrait,
F: EntityTrait,
impl<E, F> QuerySelect for SelectTwoMany<E, F> where
E: EntityTrait,
F: EntityTrait,
type QueryStatement = SelectStatement
fn query(&mut self) -> &mut SelectStatement
fn query(&mut self) -> &mut SelectStatement
Add the select SQL statement
fn select_only(self) -> Self
fn select_only(self) -> Self
Clear the selection list
fn column<C>(self, col: C) -> Self where
C: ColumnTrait,
fn column<C>(self, col: C) -> Self where
C: ColumnTrait,
Add a select column Read more
fn column_as<C, I>(self, col: C, alias: I) -> Self where
C: IntoSimpleExpr,
I: IntoIdentity,
fn column_as<C, I>(self, col: C, alias: I) -> Self where
C: IntoSimpleExpr,
I: IntoIdentity,
Add a select column with alias Read more
fn group_by<C>(self, col: C) -> Self where
C: IntoSimpleExpr,
fn group_by<C>(self, col: C) -> Self where
C: IntoSimpleExpr,
Add a group by column Read more
fn having<F>(self, filter: F) -> Self where
F: IntoCondition,
fn having<F>(self, filter: F) -> Self where
F: IntoCondition,
Add an AND HAVING expression Read more
fn join(self, join: JoinType, rel: RelationDef) -> Self
fn join(self, join: JoinType, rel: RelationDef) -> Self
Join via RelationDef
.
fn join_rev(self, join: JoinType, rel: RelationDef) -> Self
fn join_rev(self, join: JoinType, rel: RelationDef) -> Self
Join via RelationDef
but in reverse direction.
Assume when there exist a relation A to B.
You can reverse join B from A. Read more
Select lock shared
fn lock_exclusive(self) -> Self
fn lock_exclusive(self) -> Self
Select lock exclusive
impl<E, F> QueryTrait for SelectTwoMany<E, F> where
E: EntityTrait,
F: EntityTrait,
impl<E, F> QueryTrait for SelectTwoMany<E, F> where
E: EntityTrait,
F: EntityTrait,
type QueryStatement = SelectStatement
type QueryStatement = SelectStatement
Constrain the QueryStatement to QueryStatementBuilder trait
fn query(&mut self) -> &mut SelectStatement
fn query(&mut self) -> &mut SelectStatement
Get a mutable ref to the query builder
fn as_query(&self) -> &SelectStatement
fn as_query(&self) -> &SelectStatement
Get an immutable ref to the query builder
fn into_query(self) -> SelectStatement
fn into_query(self) -> SelectStatement
Take ownership of the query builder
fn build(&self, db_backend: DatabaseBackend) -> Statement
fn build(&self, db_backend: DatabaseBackend) -> Statement
Build the query as Statement
Auto Trait Implementations
impl<E, F> !RefUnwindSafe for SelectTwoMany<E, F>
impl<E, F> Send for SelectTwoMany<E, F>
impl<E, F> Sync for SelectTwoMany<E, F>
impl<E, F> Unpin for SelectTwoMany<E, F> where
E: Unpin,
F: Unpin,
impl<E, F> !UnwindSafe for SelectTwoMany<E, F>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>ⓘNotable traits for Instrumented<T>impl<T> Future for Instrumented<T> where
T: Future, type Output = <T as Future>::Output;
fn instrument(self, span: Span) -> Instrumented<Self>ⓘNotable traits for Instrumented<T>impl<T> Future for Instrumented<T> where
T: Future, type Output = <T as Future>::Output;
T: Future, type Output = <T as Future>::Output;
sourcefn in_current_span(self) -> Instrumented<Self>ⓘNotable traits for Instrumented<T>impl<T> Future for Instrumented<T> where
T: Future, type Output = <T as Future>::Output;
fn in_current_span(self) -> Instrumented<Self>ⓘNotable traits for Instrumented<T>impl<T> Future for Instrumented<T> where
T: Future, type Output = <T as Future>::Output;
T: Future, type Output = <T as Future>::Output;
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
fn vzip(self) -> V
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>ⓘNotable traits for WithDispatch<T>impl<T> Future for WithDispatch<T> where
T: Future, type Output = <T as Future>::Output;
where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>ⓘNotable traits for WithDispatch<T>impl<T> Future for WithDispatch<T> where
T: Future, type Output = <T as Future>::Output;
where
S: Into<Dispatch>,
T: Future, type Output = <T as Future>::Output;
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>ⓘNotable traits for WithDispatch<T>impl<T> Future for WithDispatch<T> where
T: Future, type Output = <T as Future>::Output;
fn with_current_subscriber(self) -> WithDispatch<Self>ⓘNotable traits for WithDispatch<T>impl<T> Future for WithDispatch<T> where
T: Future, type Output = <T as Future>::Output;
T: Future, type Output = <T as Future>::Output;
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more