backend::schema::guided_tours

Type Alias BoxedQuery

source
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>,

source§

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

Construct the diesel query dsl representation of the IN (values) clause for the given type
source§

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>

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>,

Combine two queries using a SQL UNION Read more
source§

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>,

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>,

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>,

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>,

Combine two queries using a SQL EXCEPT ALL
source§

impl<'a, ST, QS, DB, GB> DistinctDsl for BoxedSelectStatement<'a, ST, QS, DB, GB>

source§

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

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>,

source§

type Values = InsertFromSelect<BoxedSelectStatement<'a, ST, QS, DB, GB>, <T as Table>::AllColumns>

The VALUES clause to insert these records Read more
source§

fn values( self, ) -> <BoxedSelectStatement<'a, ST, QS, DB, GB> as Insertable<T>>::Values

Construct Self::Values Read more
source§

fn insert_into(self, table: T) -> InsertStatement<T, Self::Values>
where T: Table, Self: Sized,

Insert self into a given table. Read more
source§

impl<'a, ST, QS, DB, GB> LimitDsl for BoxedSelectStatement<'a, ST, QS, DB, GB>

source§

type Output = BoxedSelectStatement<'a, ST, QS, DB, GB>

The type returned by .limit
source§

fn limit( self, limit: i64, ) -> <BoxedSelectStatement<'a, ST, QS, DB, GB> as LimitDsl>::Output

See the trait documentation
source§

impl<'a, ST, QS, DB, GB> OffsetDsl for BoxedSelectStatement<'a, ST, QS, DB, GB>

source§

type Output = BoxedSelectStatement<'a, ST, QS, DB, GB>

The type returned by .offset.
source§

fn offset( self, offset: i64, ) -> <BoxedSelectStatement<'a, ST, QS, DB, GB> as OffsetDsl>::Output

See the trait documentation
source§

impl<'a, ST, QS, DB, GB> Query for BoxedSelectStatement<'a, ST, QS, DB, GB>
where DB: Backend,

source§

type SqlType = ST

The SQL type that this query represents. Read more
source§

impl<'a, ST, QS, DB, GB> QueryDsl for BoxedSelectStatement<'a, ST, QS, DB, GB>

source§

fn distinct_on<Expr>(self, expr: Expr) -> Self::Output
where Self: DistinctOnDsl<Expr>,

Adds the DISTINCT ON clause to a query. Read more
source§

fn select<Selection>(self, selection: Selection) -> Self::Output
where Selection: Expression, Self: SelectDsl<Selection>,

Adds a SELECT clause to the query. Read more
source§

fn inner_join<Rhs>(self, rhs: Rhs) -> Self::Output
where Self: JoinWithImplicitOnClause<Rhs, Inner>,

Join two tables using a SQL INNER JOIN. Read more
source§

fn left_outer_join<Rhs>(self, rhs: Rhs) -> Self::Output

Join two tables using a SQL LEFT OUTER JOIN. Read more
source§

fn left_join<Rhs>(self, rhs: Rhs) -> Self::Output

Alias for left_outer_join.
source§

fn filter<Predicate>(self, predicate: Predicate) -> Self::Output
where Self: FilterDsl<Predicate>,

Adds to the WHERE clause of a query. Read more
source§

fn or_filter<Predicate>(self, predicate: Predicate) -> Self::Output
where Self: OrFilterDsl<Predicate>,

Adds to the WHERE clause of a query using OR Read more
source§

fn find<PK>(self, id: PK) -> Self::Output
where 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::Output
where Expr: Expression, Self: OrderDsl<Expr>,

Sets the order clause of a query. Read more
source§

fn order_by<Expr>(self, expr: Expr) -> Self::Output
where Expr: Expression, Self: OrderDsl<Expr>,

Alias for order
source§

fn then_order_by<Order>(self, order: Order) -> Self::Output
where Self: ThenOrderDsl<Order>,

Appends to the ORDER BY clause of this SQL query. Read more
source§

fn group_by<GB>(self, group_by: GB) -> Self::Output
where GB: Expression, Self: GroupByDsl<GB>,

Sets the group by clause of a query. Read more
source§

fn having<Predicate>(self, predicate: Predicate) -> Self::Output
where Self: HavingDsl<Predicate>,

Adds to the HAVING clause of a query. Read more
source§

fn into_boxed<'a, DB>(self) -> Self::Output
where DB: Backend, Self: BoxedDsl<'a, DB>,

Boxes the pieces of a query into a single type. Read more
source§

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>

Walk over this QueryFragment for all passes. Read more
source§

fn to_sql( &self, out: &mut <DB as Backend>::QueryBuilder, backend: &DB, ) -> Result<(), Error>

Converts this QueryFragment to its SQL representation. Read more
source§

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§

fn is_safe_to_cache_prepared(&self, backend: &DB) -> Result<bool, Error>

Is this query safe to store in the prepared statement cache? Read more
source§

fn is_noop(&self, backend: &DB) -> Result<bool, Error>

Does walking this AST have any effect?
source§

impl<'a, ST, QS, DB, GB> QueryFragment<DB, AnsiSqlSelectStatement> for BoxedSelectStatement<'a, ST, QS, DB, GB>

source§

fn walk_ast<'b>(&'b self, out: AstPass<'_, 'b, DB>) -> Result<(), Error>

Walk over this QueryFragment for all passes. Read more
source§

fn to_sql( &self, out: &mut <DB as Backend>::QueryBuilder, backend: &DB, ) -> Result<(), Error>

Converts this QueryFragment to its SQL representation. Read more
source§

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§

fn is_safe_to_cache_prepared(&self, backend: &DB) -> Result<bool, Error>

Is this query safe to store in the prepared statement cache? Read more
source§

fn is_noop(&self, backend: &DB) -> Result<bool, Error>

Does walking this AST have any effect?
source§

impl<'a, ST, QS, DB, GB> QueryId for BoxedSelectStatement<'a, ST, QS, DB, GB>

source§

const HAS_STATIC_QUERY_ID: bool = false

Can the SQL generated by Self be uniquely identified by its type? Read more
source§

type QueryId = ()

A type which uniquely represents Self in a SQL query. Read more
source§

fn query_id() -> Option<TypeId>

Returns the type id of Self::QueryId if Self::HAS_STATIC_QUERY_ID. Returns None otherwise. Read more
source§

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>,

Executes the given query, returning a Vec with the returned rows. Read more
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,

Executes the given query, returning an Iterator with the returned rows. Read more
source§

fn get_result<'query, U>(self, conn: &mut Conn) -> Result<U, Error>
where Self: LoadQuery<'query, Conn, U>,

Runs the command, and returns the affected row. Read more
source§

fn get_results<'query, U>(self, conn: &mut Conn) -> Result<Vec<U>, Error>
where Self: LoadQuery<'query, Conn, U>,

Runs the command, returning an Vec with the affected rows. Read more
source§

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>

The return type of nullable
source§

fn nullable( self, ) -> <BoxedSelectStatement<'a, ST, QS, DB, GB> as SelectNullableDsl>::Output

See the trait documentation
source§

impl<'a, ST, QS, DB, GB> SelectQuery for BoxedSelectStatement<'a, ST, QS, DB, GB>
where DB: Backend,

source§

type SqlType = ST

The SQL type of the SELECT clause