Type Alias BoxedQuery
pub type BoxedQuery<'a, DB, ST = (Varchar, Nullable<Timestamp>, Nullable<Int4>, Nullable<Text>, Uuid, Uuid, Nullable<Uuid>, Uuid, Nullable<Varchar>, Nullable<Varchar>, Nullable<Varchar>, Bool, Uuid, Nullable<Varchar>)> = BoxedSelectStatement<'a, ST, table, DB>;
Expand description
Helper type for representing a boxed query from this table
Aliased Type§
struct BoxedQuery<'a, DB, ST = (Varchar, Nullable<Timestamp>, Nullable<Int4>, Nullable<Text>, Uuid, Uuid, Nullable<Uuid>, Uuid, Nullable<Varchar>, Nullable<Varchar>, Nullable<Varchar>, Bool, Uuid, Nullable<Varchar>)> { /* private fields */ }
Implementations
Source§impl<'a, ST, QS, DB> BoxedSelectStatement<'a, ST, QS, DB>
impl<'a, ST, QS, DB> BoxedSelectStatement<'a, ST, QS, DB>
pub fn new( select: Box<dyn QueryFragment<DB> + 'a>, from: QS, distinct: Box<dyn QueryFragment<DB> + 'a>, where_clause: BoxedWhereClause<'a, DB>, order: Option<Box<dyn QueryFragment<DB> + 'a>>, limit: Box<dyn QueryFragment<DB> + 'a>, offset: Box<dyn QueryFragment<DB> + 'a>, group_by: Box<dyn QueryFragment<DB> + 'a>, ) -> BoxedSelectStatement<'a, ST, QS, DB>
Trait Implementations
Source§impl<'a, ST, QS, DB> DistinctDsl for BoxedSelectStatement<'a, ST, QS, DB>
impl<'a, ST, QS, DB> DistinctDsl for BoxedSelectStatement<'a, ST, QS, DB>
Source§type Output = BoxedSelectStatement<'a, ST, QS, DB>
type Output = BoxedSelectStatement<'a, ST, QS, DB>
The type returned by
.distinct
Source§fn distinct(
self,
) -> <BoxedSelectStatement<'a, ST, QS, DB> as DistinctDsl>::Output
fn distinct( self, ) -> <BoxedSelectStatement<'a, ST, QS, DB> as DistinctDsl>::Output
See the trait documentation.
Source§impl<'a, ST, QS, DB, Predicate> FilterDsl<Predicate> for BoxedSelectStatement<'a, ST, QS, DB>where
BoxedWhereClause<'a, DB>: WhereAnd<Predicate, Output = BoxedWhereClause<'a, DB>>,
Predicate: AppearsOnTable<QS, SqlType = Bool> + NonAggregate,
impl<'a, ST, QS, DB, Predicate> FilterDsl<Predicate> for BoxedSelectStatement<'a, ST, QS, DB>where
BoxedWhereClause<'a, DB>: WhereAnd<Predicate, Output = BoxedWhereClause<'a, DB>>,
Predicate: AppearsOnTable<QS, SqlType = Bool> + NonAggregate,
Source§type Output = BoxedSelectStatement<'a, ST, QS, DB>
type Output = BoxedSelectStatement<'a, ST, QS, DB>
The type returned by
.filter
.Source§impl<'a, ST, QS, DB, Expr> GroupByDsl<Expr> for BoxedSelectStatement<'a, ST, QS, DB>where
DB: Backend,
Expr: QueryFragment<DB> + AppearsOnTable<QS> + 'a,
BoxedSelectStatement<'a, ST, QS, DB>: Query,
impl<'a, ST, QS, DB, Expr> GroupByDsl<Expr> for BoxedSelectStatement<'a, ST, QS, DB>where
DB: Backend,
Expr: QueryFragment<DB> + AppearsOnTable<QS> + 'a,
BoxedSelectStatement<'a, ST, QS, DB>: Query,
Source§type Output = BoxedSelectStatement<'a, ST, QS, DB>
type Output = BoxedSelectStatement<'a, ST, QS, DB>
The type returned by
.group_by
Source§fn group_by(
self,
group_by: Expr,
) -> <BoxedSelectStatement<'a, ST, QS, DB> as GroupByDsl<Expr>>::Output
fn group_by( self, group_by: Expr, ) -> <BoxedSelectStatement<'a, ST, QS, DB> as GroupByDsl<Expr>>::Output
See the trait documentation.
Source§impl<'a, ST, QS, DB, T> Insertable<T> for BoxedSelectStatement<'a, ST, QS, DB>
impl<'a, ST, QS, DB, T> Insertable<T> for BoxedSelectStatement<'a, ST, QS, DB>
Source§type Values = InsertFromSelect<BoxedSelectStatement<'a, ST, QS, DB>, <T as Table>::AllColumns>
type Values = InsertFromSelect<BoxedSelectStatement<'a, ST, QS, DB>, <T as Table>::AllColumns>
The
VALUES
clause to insert these records Read moreSource§fn values(
self,
) -> <BoxedSelectStatement<'a, ST, QS, DB> as Insertable<T>>::Values
fn values( self, ) -> <BoxedSelectStatement<'a, ST, QS, DB> as Insertable<T>>::Values
Construct
Self::Values
Read moreSource§fn insert_into(self, table: T) -> InsertStatement<T, Self::Values>where
Self: Sized,
fn insert_into(self, table: T) -> InsertStatement<T, Self::Values>where
Self: Sized,
Insert
self
into a given table. Read moreSource§impl<'a, ST, QS, DB> LimitDsl for BoxedSelectStatement<'a, ST, QS, DB>
impl<'a, ST, QS, DB> LimitDsl for BoxedSelectStatement<'a, ST, QS, DB>
Source§impl<'a, ST, QS, DB> OffsetDsl for BoxedSelectStatement<'a, ST, QS, DB>
impl<'a, ST, QS, DB> OffsetDsl for BoxedSelectStatement<'a, ST, QS, DB>
Source§impl<'a, ST, QS, DB, Predicate> OrFilterDsl<Predicate> for BoxedSelectStatement<'a, ST, QS, DB>where
BoxedWhereClause<'a, DB>: WhereOr<Predicate, Output = BoxedWhereClause<'a, DB>>,
Predicate: AppearsOnTable<QS, SqlType = Bool> + NonAggregate,
impl<'a, ST, QS, DB, Predicate> OrFilterDsl<Predicate> for BoxedSelectStatement<'a, ST, QS, DB>where
BoxedWhereClause<'a, DB>: WhereOr<Predicate, Output = BoxedWhereClause<'a, DB>>,
Predicate: AppearsOnTable<QS, SqlType = Bool> + NonAggregate,
Source§type Output = BoxedSelectStatement<'a, ST, QS, DB>
type Output = BoxedSelectStatement<'a, ST, QS, DB>
The type returned by
.filter
.Source§fn or_filter(
self,
predicate: Predicate,
) -> <BoxedSelectStatement<'a, ST, QS, DB> as OrFilterDsl<Predicate>>::Output
fn or_filter( self, predicate: Predicate, ) -> <BoxedSelectStatement<'a, ST, QS, DB> as OrFilterDsl<Predicate>>::Output
See the trait documentation.
Source§impl<'a, ST, QS, DB, Order> OrderDsl<Order> for BoxedSelectStatement<'a, ST, QS, DB>
impl<'a, ST, QS, DB, Order> OrderDsl<Order> for BoxedSelectStatement<'a, ST, QS, DB>
Source§type Output = BoxedSelectStatement<'a, ST, QS, DB>
type Output = BoxedSelectStatement<'a, ST, QS, DB>
The type returned by
.order
.Source§impl<'a, ST, QS, DB> Query for BoxedSelectStatement<'a, ST, QS, DB>where
DB: Backend,
impl<'a, ST, QS, DB> Query for BoxedSelectStatement<'a, ST, QS, DB>where
DB: Backend,
Source§impl<'a, ST, QS, DB> QueryDsl for BoxedSelectStatement<'a, ST, QS, DB>
impl<'a, ST, QS, DB> QueryDsl for BoxedSelectStatement<'a, ST, QS, DB>
Source§fn distinct(self) -> Self::Outputwhere
Self: DistinctDsl,
fn distinct(self) -> Self::Outputwhere
Self: DistinctDsl,
Adds the
DISTINCT
keyword to a query. Read moreSource§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 count(self) -> Self::Output
fn count(self) -> Self::Output
Get the count of a query. This is equivalent to
.select(count_star())
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 limit(self, limit: i64) -> Self::Outputwhere
Self: LimitDsl,
fn limit(self, limit: i64) -> Self::Outputwhere
Self: LimitDsl,
Sets the limit clause of the query. Read more
Source§fn offset(self, offset: i64) -> Self::Outputwhere
Self: OffsetDsl,
fn offset(self, offset: i64) -> Self::Outputwhere
Self: OffsetDsl,
Sets the offset clause of the query. Read more
Source§fn for_update(self) -> Self::Outputwhere
Self: ForUpdateDsl,
fn for_update(self) -> Self::Outputwhere
Self: ForUpdateDsl,
Adds
FOR UPDATE
to the end of the select statement. Read moreSource§fn for_no_key_update(self) -> Self::Outputwhere
Self: LockingDsl<ForNoKeyUpdate>,
fn for_no_key_update(self) -> Self::Outputwhere
Self: LockingDsl<ForNoKeyUpdate>,
Adds
FOR NO KEY UPDATE
to the end of the select statement. Read moreAdds
FOR SHARE
to the end of the select statement. Read moreAdds
FOR KEY SHARE
to the end of the select statement. Read moreSource§fn skip_locked(self) -> Self::Outputwhere
Self: ModifyLockDsl<SkipLocked>,
fn skip_locked(self) -> Self::Outputwhere
Self: ModifyLockDsl<SkipLocked>,
Source§fn into_boxed<'a, DB>(self) -> Self::Output
fn into_boxed<'a, DB>(self) -> Self::Output
Boxes the pieces of a query into a single type. Read more
Source§fn single_value(self) -> Self::Outputwhere
Self: SingleValueDsl,
fn single_value(self) -> Self::Outputwhere
Self: SingleValueDsl,
Wraps this select statement in parenthesis, allowing it to be used
as an expression. Read more
Source§impl<'a, ST, QS, DB> QueryFragment<DB> for BoxedSelectStatement<'a, ST, QS, DB>
impl<'a, ST, QS, DB> QueryFragment<DB> for BoxedSelectStatement<'a, ST, QS, DB>
Source§fn walk_ast(&self, out: AstPass<'_, DB>) -> Result<(), Error>
fn walk_ast(&self, out: AstPass<'_, DB>) -> Result<(), Error>
Walk over this
QueryFragment
for all passes. Read moreSource§fn to_sql(&self, out: &mut <DB as Backend>::QueryBuilder) -> Result<(), Error>
fn to_sql(&self, out: &mut <DB as Backend>::QueryBuilder) -> Result<(), Error>
Converts this
QueryFragment
to its SQL representation. Read moreSource§fn collect_binds(
&self,
out: &mut <DB as Backend>::BindCollector,
metadata_lookup: &<DB as TypeMetadata>::MetadataLookup,
) -> Result<(), Error>
fn collect_binds( &self, out: &mut <DB as Backend>::BindCollector, metadata_lookup: &<DB as TypeMetadata>::MetadataLookup, ) -> Result<(), Error>
Serializes all bind parameters in this query. Read more
Source§impl<'a, ST, QS, DB> QueryId for BoxedSelectStatement<'a, ST, QS, DB>
impl<'a, ST, QS, DB> QueryId for BoxedSelectStatement<'a, ST, QS, DB>
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> RunQueryDsl<Conn> for BoxedSelectStatement<'a, ST, QS, DB>
impl<'a, ST, QS, DB, Conn> RunQueryDsl<Conn> for BoxedSelectStatement<'a, ST, QS, DB>
Source§fn execute(self, conn: &Conn) -> Result<usize, Error>where
Conn: Connection,
Self: ExecuteDsl<Conn>,
fn execute(self, conn: &Conn) -> Result<usize, Error>where
Conn: Connection,
Self: ExecuteDsl<Conn>,
Executes the given command, returning the number of rows affected. Read more
Source§fn load<U>(self, conn: &Conn) -> Result<Vec<U>, Error>where
Self: LoadQuery<Conn, U>,
fn load<U>(self, conn: &Conn) -> Result<Vec<U>, Error>where
Self: LoadQuery<Conn, U>,
Executes the given query, returning a
Vec
with the returned rows. Read moreSource§fn get_result<U>(self, conn: &Conn) -> Result<U, Error>where
Self: LoadQuery<Conn, U>,
fn get_result<U>(self, conn: &Conn) -> Result<U, Error>where
Self: LoadQuery<Conn, U>,
Runs the command, and returns the affected row. Read more
Source§impl<'a, ST, QS, DB, Selection> SelectDsl<Selection> for BoxedSelectStatement<'a, ST, QS, DB>
impl<'a, ST, QS, DB, Selection> SelectDsl<Selection> for BoxedSelectStatement<'a, ST, QS, DB>
Source§type Output = BoxedSelectStatement<'a, <Selection as Expression>::SqlType, QS, DB>
type Output = BoxedSelectStatement<'a, <Selection as Expression>::SqlType, QS, DB>
The type returned by
.select
Source§impl<'a, ST, QS, DB> SelectNullableDsl for BoxedSelectStatement<'a, ST, QS, DB>where
ST: NotNull,
impl<'a, ST, QS, DB> SelectNullableDsl for BoxedSelectStatement<'a, ST, QS, DB>where
ST: NotNull,
Source§type Output = BoxedSelectStatement<'a, Nullable<ST>, QS, DB>
type Output = BoxedSelectStatement<'a, Nullable<ST>, QS, DB>
The return type of
nullable
Source§fn nullable(
self,
) -> <BoxedSelectStatement<'a, ST, QS, DB> as SelectNullableDsl>::Output
fn nullable( self, ) -> <BoxedSelectStatement<'a, ST, QS, DB> as SelectNullableDsl>::Output
See the trait documentation
Source§impl<'a, ST, QS, DB> SelectQuery for BoxedSelectStatement<'a, ST, QS, DB>where
DB: Backend,
impl<'a, ST, QS, DB> SelectQuery for BoxedSelectStatement<'a, ST, QS, DB>where
DB: Backend,
Source§impl<'a, ST, QS, DB, Order> ThenOrderDsl<Order> for BoxedSelectStatement<'a, ST, QS, DB>
impl<'a, ST, QS, DB, Order> ThenOrderDsl<Order> for BoxedSelectStatement<'a, ST, QS, DB>
Source§type Output = BoxedSelectStatement<'a, ST, QS, DB>
type Output = BoxedSelectStatement<'a, ST, QS, DB>
The type returned by
.then_order_by
.Source§fn then_order_by(
self,
order: Order,
) -> <BoxedSelectStatement<'a, ST, QS, DB> as ThenOrderDsl<Order>>::Output
fn then_order_by( self, order: Order, ) -> <BoxedSelectStatement<'a, ST, QS, DB> as ThenOrderDsl<Order>>::Output
See the trait documentation.