pub trait Query {
    type SqlType;
}
Expand description

A complete SQL query with a return type.

This can be a select statement, or a command such as update or insert with a RETURNING clause. Unlike Expression, types implementing this trait are guaranteed to be executable on their own.

A type which doesn’t implement this trait may still represent a complete SQL query. For example, an INSERT statement without a RETURNING clause will not implement this trait, but can still be executed.

Required Associated Types§

source

type SqlType

The SQL type that this query represents.

This is the SQL type of the SELECT clause for select statements, and the SQL type of the RETURNING clause for insert, update, or delete statements.

Implementations on Foreign Types§

source§

impl<'a, T: Query> Query for &'a T

§

type SqlType = <T as Query>::SqlType

Implementors§

source§

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

§

type SqlType = ST

source§

impl<DB, Q> Query for BoxedSqlQuery<'_, DB, Q>where DB: Backend,

source§

impl<F, S, D, W, O, LOf, G, H, LC> Query for SelectStatement<F, S, D, W, O, LOf, G, H, LC>where G: ValidGroupByClause, S: SelectClauseExpression<F>, S::Selection: ValidGrouping<G::Expressions>, W: ValidWhereClause<F>,

source§

impl<Inner> Query for SqlQuery<Inner>

source§

impl<Q, Value> Query for UncheckedBind<Q, Value>where Q: Query,

§

type SqlType = <Q as Query>::SqlType

source§

impl<ST, T> Query for SqlLiteral<ST, T>where Self: Expression,

§

type SqlType = ST

source§

impl<T, U, Op, Ret> Query for InsertStatement<T, U, Op, ReturningClause<Ret>>where T: QuerySource, Ret: Expression + SelectableExpression<T> + NonAggregate,

§

type SqlType = <Ret as Expression>::SqlType

source§

impl<T, U, Ret> Query for DeleteStatement<T, U, ReturningClause<Ret>>where T: Table, Ret: SelectableExpression<T>,

§

type SqlType = <Ret as Expression>::SqlType

source§

impl<T, U, V, Ret> Query for UpdateStatement<T, U, V, ReturningClause<Ret>>where T: Table, Ret: Expression + SelectableExpression<T> + ValidGrouping<()>, Ret::IsAggregate: MixedAggregates<No, Output = No>,

§

type SqlType = <Ret as Expression>::SqlType