pub type BoxedQuery<'a, DB, ST = SqlType> = BoxedSelectStatement<'a, ST, FromClause<table>, DB>;
Expand description
Helper type for representing a boxed query from this table
Aliased Type§
struct BoxedQuery<'a, DB, ST = SqlType> {
pub select: Box<dyn QueryFragment<DB> + Send + 'a>,
pub from: FromClause<table>,
pub distinct: Box<dyn QueryFragment<DB> + Send + 'a>,
pub where_clause: BoxedWhereClause<'a, DB>,
pub order: Option<Box<dyn QueryFragment<DB> + Send + 'a>>,
pub limit_offset: BoxedLimitOffsetClause<'a, DB>,
pub group_by: Box<dyn QueryFragment<DB> + Send + 'a>,
pub having: Box<dyn QueryFragment<DB> + Send + 'a>,
/* private fields */
}
Fields§
§select: Box<dyn QueryFragment<DB> + Send + 'a>
The select clause of the query
from: FromClause<table>
The from clause of the query
distinct: Box<dyn QueryFragment<DB> + Send + 'a>
The distinct clause of the query
where_clause: BoxedWhereClause<'a, DB>
The where clause of the query
order: Option<Box<dyn QueryFragment<DB> + Send + 'a>>
The order clause of the query
limit_offset: BoxedLimitOffsetClause<'a, DB>
The combined limit/offset clause of the query
group_by: Box<dyn QueryFragment<DB> + Send + 'a>
The group by clause of the query
having: Box<dyn QueryFragment<DB> + Send + 'a>
The having clause of the query
Trait Implementations
source§impl<'a, ST, QS, DB, GB> AsInExpression<ST> for BoxedSelectStatement<'a, ST, QS, DB, GB>where
ST: SqlType + TypedExpressionType,
Subselect<BoxedSelectStatement<'a, ST, QS, DB, GB>, ST>: Expression<SqlType = ST>,
impl<'a, ST, QS, DB, GB> AsInExpression<ST> for BoxedSelectStatement<'a, ST, QS, DB, GB>where
ST: SqlType + TypedExpressionType,
Subselect<BoxedSelectStatement<'a, ST, QS, DB, GB>, ST>: Expression<SqlType = ST>,
source§type InExpression = Subselect<BoxedSelectStatement<'a, ST, QS, DB, GB>, ST>
type InExpression = Subselect<BoxedSelectStatement<'a, ST, QS, DB, GB>, ST>
Type of the expression returned by AsInExpression::as_in_expression
source§fn as_in_expression(
self,
) -> <BoxedSelectStatement<'a, ST, QS, DB, GB> as AsInExpression<ST>>::InExpression
fn as_in_expression( self, ) -> <BoxedSelectStatement<'a, ST, QS, DB, GB> as AsInExpression<ST>>::InExpression
Construct the diesel query dsl representation of
the
IN (values)
clause for the given typesource§impl<'a, ST, QS, DB, GB> CombineDsl for BoxedSelectStatement<'a, ST, QS, DB, GB>where
BoxedSelectStatement<'a, ST, QS, DB, GB>: Query,
impl<'a, ST, QS, DB, GB> CombineDsl for BoxedSelectStatement<'a, ST, QS, DB, GB>where
BoxedSelectStatement<'a, ST, QS, DB, GB>: Query,
source§type Query = BoxedSelectStatement<'a, ST, QS, DB, GB>
type Query = BoxedSelectStatement<'a, ST, QS, DB, GB>
What kind of query does this type represent?
source§fn union<Rhs>(
self,
rhs: Rhs,
) -> CombinationClause<Union, Distinct, <BoxedSelectStatement<'a, ST, QS, DB, GB> as CombineDsl>::Query, <Rhs as AsQuery>::Query>where
Rhs: AsQuery<SqlType = <<BoxedSelectStatement<'a, ST, QS, DB, GB> as CombineDsl>::Query as Query>::SqlType>,
fn union<Rhs>(
self,
rhs: Rhs,
) -> CombinationClause<Union, Distinct, <BoxedSelectStatement<'a, ST, QS, DB, GB> as CombineDsl>::Query, <Rhs as AsQuery>::Query>where
Rhs: AsQuery<SqlType = <<BoxedSelectStatement<'a, ST, QS, DB, GB> as CombineDsl>::Query as Query>::SqlType>,
Combine two queries using a SQL
UNION
Read moresource§fn union_all<Rhs>(
self,
rhs: Rhs,
) -> CombinationClause<Union, All, <BoxedSelectStatement<'a, ST, QS, DB, GB> as CombineDsl>::Query, <Rhs as AsQuery>::Query>where
Rhs: AsQuery<SqlType = <<BoxedSelectStatement<'a, ST, QS, DB, GB> as CombineDsl>::Query as Query>::SqlType>,
fn union_all<Rhs>(
self,
rhs: Rhs,
) -> CombinationClause<Union, All, <BoxedSelectStatement<'a, ST, QS, DB, GB> as CombineDsl>::Query, <Rhs as AsQuery>::Query>where
Rhs: AsQuery<SqlType = <<BoxedSelectStatement<'a, ST, QS, DB, GB> as CombineDsl>::Query as Query>::SqlType>,
Combine two queries using a SQL
UNION ALL
source§fn intersect<Rhs>(
self,
rhs: Rhs,
) -> CombinationClause<Intersect, Distinct, <BoxedSelectStatement<'a, ST, QS, DB, GB> as CombineDsl>::Query, <Rhs as AsQuery>::Query>where
Rhs: AsQuery<SqlType = <<BoxedSelectStatement<'a, ST, QS, DB, GB> as CombineDsl>::Query as Query>::SqlType>,
fn intersect<Rhs>(
self,
rhs: Rhs,
) -> CombinationClause<Intersect, Distinct, <BoxedSelectStatement<'a, ST, QS, DB, GB> as CombineDsl>::Query, <Rhs as AsQuery>::Query>where
Rhs: AsQuery<SqlType = <<BoxedSelectStatement<'a, ST, QS, DB, GB> as CombineDsl>::Query as Query>::SqlType>,
Combine two queries using a SQL
INTERSECT
source§fn intersect_all<Rhs>(
self,
rhs: Rhs,
) -> CombinationClause<Intersect, All, <BoxedSelectStatement<'a, ST, QS, DB, GB> as CombineDsl>::Query, <Rhs as AsQuery>::Query>where
Rhs: AsQuery<SqlType = <<BoxedSelectStatement<'a, ST, QS, DB, GB> as CombineDsl>::Query as Query>::SqlType>,
fn intersect_all<Rhs>(
self,
rhs: Rhs,
) -> CombinationClause<Intersect, All, <BoxedSelectStatement<'a, ST, QS, DB, GB> as CombineDsl>::Query, <Rhs as AsQuery>::Query>where
Rhs: AsQuery<SqlType = <<BoxedSelectStatement<'a, ST, QS, DB, GB> as CombineDsl>::Query as Query>::SqlType>,
Combine two queries using a SQL
INTERSECT ALL
source§fn except<Rhs>(
self,
rhs: Rhs,
) -> CombinationClause<Except, Distinct, <BoxedSelectStatement<'a, ST, QS, DB, GB> as CombineDsl>::Query, <Rhs as AsQuery>::Query>where
Rhs: AsQuery<SqlType = <<BoxedSelectStatement<'a, ST, QS, DB, GB> as CombineDsl>::Query as Query>::SqlType>,
fn except<Rhs>(
self,
rhs: Rhs,
) -> CombinationClause<Except, Distinct, <BoxedSelectStatement<'a, ST, QS, DB, GB> as CombineDsl>::Query, <Rhs as AsQuery>::Query>where
Rhs: AsQuery<SqlType = <<BoxedSelectStatement<'a, ST, QS, DB, GB> as CombineDsl>::Query as Query>::SqlType>,
Combine two queries using a SQL
EXCEPT
source§fn except_all<Rhs>(
self,
rhs: Rhs,
) -> CombinationClause<Except, All, <BoxedSelectStatement<'a, ST, QS, DB, GB> as CombineDsl>::Query, <Rhs as AsQuery>::Query>where
Rhs: AsQuery<SqlType = <<BoxedSelectStatement<'a, ST, QS, DB, GB> as CombineDsl>::Query as Query>::SqlType>,
fn except_all<Rhs>(
self,
rhs: Rhs,
) -> CombinationClause<Except, All, <BoxedSelectStatement<'a, ST, QS, DB, GB> as CombineDsl>::Query, <Rhs as AsQuery>::Query>where
Rhs: AsQuery<SqlType = <<BoxedSelectStatement<'a, ST, QS, DB, GB> as CombineDsl>::Query as Query>::SqlType>,
Combine two queries using a SQL
EXCEPT ALL
source§impl<'a, ST, QS, DB, GB> DistinctDsl for BoxedSelectStatement<'a, ST, QS, DB, GB>
impl<'a, ST, QS, DB, GB> DistinctDsl for BoxedSelectStatement<'a, ST, QS, DB, GB>
source§type Output = BoxedSelectStatement<'a, ST, QS, DB, GB>
type Output = BoxedSelectStatement<'a, ST, QS, DB, GB>
The type returned by
.distinct
source§fn distinct(
self,
) -> <BoxedSelectStatement<'a, ST, QS, DB, GB> as DistinctDsl>::Output
fn distinct( self, ) -> <BoxedSelectStatement<'a, ST, QS, DB, GB> as DistinctDsl>::Output
See the trait documentation.
source§impl<'a, ST, QS, DB, T, GB> Insertable<T> for BoxedSelectStatement<'a, ST, QS, DB, GB>where
T: Table,
BoxedSelectStatement<'a, ST, QS, DB, GB>: Query,
<<T as Table>::AllColumns as ValidGrouping<()>>::IsAggregate: MixedAggregates<No, Output = No>,
impl<'a, ST, QS, DB, T, GB> Insertable<T> for BoxedSelectStatement<'a, ST, QS, DB, GB>where
T: Table,
BoxedSelectStatement<'a, ST, QS, DB, GB>: Query,
<<T as Table>::AllColumns as ValidGrouping<()>>::IsAggregate: MixedAggregates<No, Output = No>,
source§type Values = InsertFromSelect<BoxedSelectStatement<'a, ST, QS, DB, GB>, <T as Table>::AllColumns>
type Values = InsertFromSelect<BoxedSelectStatement<'a, ST, QS, DB, GB>, <T as Table>::AllColumns>
The
VALUES
clause to insert these records Read moresource§fn values(
self,
) -> <BoxedSelectStatement<'a, ST, QS, DB, GB> as Insertable<T>>::Values
fn values( self, ) -> <BoxedSelectStatement<'a, ST, QS, DB, GB> as Insertable<T>>::Values
Construct
Self::Values
Read moresource§fn insert_into(self, table: T) -> InsertStatement<T, Self::Values>
fn insert_into(self, table: T) -> InsertStatement<T, Self::Values>
Insert
self
into a given table. Read moresource§impl<'a, ST, QS, DB, GB> LimitDsl for BoxedSelectStatement<'a, ST, QS, DB, GB>
impl<'a, ST, QS, DB, GB> LimitDsl for BoxedSelectStatement<'a, ST, QS, DB, GB>
source§impl<'a, ST, QS, DB, GB> OffsetDsl for BoxedSelectStatement<'a, ST, QS, DB, GB>
impl<'a, ST, QS, DB, GB> OffsetDsl for BoxedSelectStatement<'a, ST, QS, DB, GB>
source§impl<'a, ST, QS, DB, GB> Query for BoxedSelectStatement<'a, ST, QS, DB, GB>where
DB: Backend,
impl<'a, ST, QS, DB, GB> Query for BoxedSelectStatement<'a, ST, QS, DB, GB>where
DB: Backend,
source§impl<'a, ST, QS, DB, GB> QueryDsl for BoxedSelectStatement<'a, ST, QS, DB, GB>
impl<'a, ST, QS, DB, GB> QueryDsl for BoxedSelectStatement<'a, ST, QS, DB, GB>
source§fn distinct_on<Expr>(self, expr: Expr) -> Self::Outputwhere
Self: DistinctOnDsl<Expr>,
fn distinct_on<Expr>(self, expr: Expr) -> Self::Outputwhere
Self: DistinctOnDsl<Expr>,
Adds the
DISTINCT ON
clause to a query. Read moresource§fn select<Selection>(self, selection: Selection) -> Self::Outputwhere
Selection: Expression,
Self: SelectDsl<Selection>,
fn select<Selection>(self, selection: Selection) -> Self::Outputwhere
Selection: Expression,
Self: SelectDsl<Selection>,
Adds a
SELECT
clause to the query. Read moresource§fn inner_join<Rhs>(self, rhs: Rhs) -> Self::Outputwhere
Self: JoinWithImplicitOnClause<Rhs, Inner>,
fn inner_join<Rhs>(self, rhs: Rhs) -> Self::Outputwhere
Self: JoinWithImplicitOnClause<Rhs, Inner>,
Join two tables using a SQL
INNER JOIN
. Read moresource§fn left_outer_join<Rhs>(self, rhs: Rhs) -> Self::Outputwhere
Self: JoinWithImplicitOnClause<Rhs, LeftOuter>,
fn left_outer_join<Rhs>(self, rhs: Rhs) -> Self::Outputwhere
Self: JoinWithImplicitOnClause<Rhs, LeftOuter>,
Join two tables using a SQL
LEFT OUTER JOIN
. Read moresource§fn left_join<Rhs>(self, rhs: Rhs) -> Self::Outputwhere
Self: JoinWithImplicitOnClause<Rhs, LeftOuter>,
fn left_join<Rhs>(self, rhs: Rhs) -> Self::Outputwhere
Self: JoinWithImplicitOnClause<Rhs, LeftOuter>,
Alias for
left_outer_join
.source§fn filter<Predicate>(self, predicate: Predicate) -> Self::Outputwhere
Self: FilterDsl<Predicate>,
fn filter<Predicate>(self, predicate: Predicate) -> Self::Outputwhere
Self: FilterDsl<Predicate>,
Adds to the
WHERE
clause of a query. Read moresource§fn or_filter<Predicate>(self, predicate: Predicate) -> Self::Outputwhere
Self: OrFilterDsl<Predicate>,
fn or_filter<Predicate>(self, predicate: Predicate) -> Self::Outputwhere
Self: OrFilterDsl<Predicate>,
source§fn find<PK>(self, id: PK) -> Self::Outputwhere
Self: FindDsl<PK>,
fn find<PK>(self, id: PK) -> Self::Outputwhere
Self: FindDsl<PK>,
Attempts to find a single record from the given table by primary key. Read more
source§fn order<Expr>(self, expr: Expr) -> Self::Outputwhere
Expr: Expression,
Self: OrderDsl<Expr>,
fn order<Expr>(self, expr: Expr) -> Self::Outputwhere
Expr: Expression,
Self: OrderDsl<Expr>,
Sets the order clause of a query. Read more
source§fn order_by<Expr>(self, expr: Expr) -> Self::Outputwhere
Expr: Expression,
Self: OrderDsl<Expr>,
fn order_by<Expr>(self, expr: Expr) -> Self::Outputwhere
Expr: Expression,
Self: OrderDsl<Expr>,
Alias for
order
source§fn then_order_by<Order>(self, order: Order) -> Self::Outputwhere
Self: ThenOrderDsl<Order>,
fn then_order_by<Order>(self, order: Order) -> Self::Outputwhere
Self: ThenOrderDsl<Order>,
Appends to the
ORDER BY
clause of this SQL query. Read moresource§fn group_by<GB>(self, group_by: GB) -> Self::Outputwhere
GB: Expression,
Self: GroupByDsl<GB>,
fn group_by<GB>(self, group_by: GB) -> Self::Outputwhere
GB: Expression,
Self: GroupByDsl<GB>,
Sets the
group by
clause of a query. Read moresource§impl<'a, ST, QS, DB, GB> QueryFragment<DB> for BoxedSelectStatement<'a, ST, QS, DB, GB>where
DB: Backend,
BoxedSelectStatement<'a, ST, QS, DB, GB>: QueryFragment<DB, <DB as SqlDialect>::SelectStatementSyntax>,
impl<'a, ST, QS, DB, GB> QueryFragment<DB> for BoxedSelectStatement<'a, ST, QS, DB, GB>where
DB: Backend,
BoxedSelectStatement<'a, ST, QS, DB, GB>: QueryFragment<DB, <DB as SqlDialect>::SelectStatementSyntax>,
source§fn walk_ast<'b>(&'b self, pass: AstPass<'_, 'b, DB>) -> Result<(), Error>
fn walk_ast<'b>(&'b self, pass: AstPass<'_, 'b, DB>) -> Result<(), Error>
Walk over this
QueryFragment
for all passes. Read moresource§fn to_sql(
&self,
out: &mut <DB as Backend>::QueryBuilder,
backend: &DB,
) -> Result<(), Error>
fn to_sql( &self, out: &mut <DB as Backend>::QueryBuilder, backend: &DB, ) -> Result<(), Error>
Converts this
QueryFragment
to its SQL representation. Read moresource§fn collect_binds<'b>(
&'b self,
out: &mut <DB as Backend>::BindCollector<'b>,
metadata_lookup: &mut <DB as TypeMetadata>::MetadataLookup,
backend: &'b DB,
) -> Result<(), Error>
fn collect_binds<'b>( &'b self, out: &mut <DB as Backend>::BindCollector<'b>, metadata_lookup: &mut <DB as TypeMetadata>::MetadataLookup, backend: &'b DB, ) -> Result<(), Error>
Serializes all bind parameters in this query. Read more
source§impl<'a, ST, QS, DB, GB> QueryFragment<DB, AnsiSqlSelectStatement> for BoxedSelectStatement<'a, ST, QS, DB, GB>where
DB: Backend<SelectStatementSyntax = AnsiSqlSelectStatement> + DieselReserveSpecialization,
QS: QueryFragment<DB>,
BoxedLimitOffsetClause<'a, DB>: QueryFragment<DB>,
impl<'a, ST, QS, DB, GB> QueryFragment<DB, AnsiSqlSelectStatement> for BoxedSelectStatement<'a, ST, QS, DB, GB>where
DB: Backend<SelectStatementSyntax = AnsiSqlSelectStatement> + DieselReserveSpecialization,
QS: QueryFragment<DB>,
BoxedLimitOffsetClause<'a, DB>: QueryFragment<DB>,
source§fn walk_ast<'b>(&'b self, out: AstPass<'_, 'b, DB>) -> Result<(), Error>
fn walk_ast<'b>(&'b self, out: AstPass<'_, 'b, DB>) -> Result<(), Error>
Walk over this
QueryFragment
for all passes. Read moresource§fn to_sql(
&self,
out: &mut <DB as Backend>::QueryBuilder,
backend: &DB,
) -> Result<(), Error>
fn to_sql( &self, out: &mut <DB as Backend>::QueryBuilder, backend: &DB, ) -> Result<(), Error>
Converts this
QueryFragment
to its SQL representation. Read moresource§fn collect_binds<'b>(
&'b self,
out: &mut <DB as Backend>::BindCollector<'b>,
metadata_lookup: &mut <DB as TypeMetadata>::MetadataLookup,
backend: &'b DB,
) -> Result<(), Error>
fn collect_binds<'b>( &'b self, out: &mut <DB as Backend>::BindCollector<'b>, metadata_lookup: &mut <DB as TypeMetadata>::MetadataLookup, backend: &'b DB, ) -> Result<(), Error>
Serializes all bind parameters in this query. Read more
source§impl<'a, ST, QS, DB, GB> QueryId for BoxedSelectStatement<'a, ST, QS, DB, GB>
impl<'a, ST, QS, DB, GB> QueryId for BoxedSelectStatement<'a, ST, QS, DB, GB>
source§const HAS_STATIC_QUERY_ID: bool = false
const HAS_STATIC_QUERY_ID: bool = false
Can the SQL generated by
Self
be uniquely identified by its type? Read moresource§impl<'a, ST, QS, DB, Conn, GB> RunQueryDsl<Conn> for BoxedSelectStatement<'a, ST, QS, DB, GB>
impl<'a, ST, QS, DB, Conn, GB> RunQueryDsl<Conn> for BoxedSelectStatement<'a, ST, QS, DB, GB>
source§fn load<'query, U>(self, conn: &mut Conn) -> Result<Vec<U>, Error>where
Self: LoadQuery<'query, Conn, U>,
fn load<'query, U>(self, conn: &mut Conn) -> Result<Vec<U>, Error>where
Self: LoadQuery<'query, Conn, U>,
source§fn load_iter<'conn, 'query, U, B>(
self,
conn: &'conn mut Conn,
) -> Result<Self::RowIter<'conn>, Error>where
'query: 'conn,
U: 'conn,
Self: LoadQuery<'query, Conn, U, B> + 'conn,
fn load_iter<'conn, 'query, U, B>(
self,
conn: &'conn mut Conn,
) -> Result<Self::RowIter<'conn>, Error>where
'query: 'conn,
U: 'conn,
Self: LoadQuery<'query, Conn, U, B> + 'conn,
source§impl<'a, ST, QS, DB, GB> SelectNullableDsl for BoxedSelectStatement<'a, ST, QS, DB, GB>where
ST: IntoNullable,
impl<'a, ST, QS, DB, GB> SelectNullableDsl for BoxedSelectStatement<'a, ST, QS, DB, GB>where
ST: IntoNullable,
source§type Output = BoxedSelectStatement<'a, <ST as IntoNullable>::Nullable, QS, DB>
type Output = BoxedSelectStatement<'a, <ST as IntoNullable>::Nullable, QS, DB>
The return type of
nullable
source§fn nullable(
self,
) -> <BoxedSelectStatement<'a, ST, QS, DB, GB> as SelectNullableDsl>::Output
fn nullable( self, ) -> <BoxedSelectStatement<'a, ST, QS, DB, GB> as SelectNullableDsl>::Output
See the trait documentation