Skip to main content

Query

Trait Query 

Source
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.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl<T: Query> Query for &T

Implementors§

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,

Source§

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

Source§

type SqlType = ST

Source§

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

Source§

type SqlType = ST

Source§

impl<T, U, Op, Ret> Query for InsertStatement<T, U, Op, ReturningClause<Ret>>

Source§

impl<T, U, Ret> Query for DeleteStatement<T, U, ReturningClause<Ret>>

Source§

impl<T, U, V, Ret> Query for UpdateStatement<T, U, V, ReturningClause<Ret>>

Source§

impl<T> Query for CollectedQuery<T>