Trait diesel::query_builder::QueryFragment

source ·
pub trait QueryFragment<DB: Backend, SP = NotSpecialized> {
    // Required method
    fn walk_ast<'b>(&'b self, pass: AstPass<'_, 'b, DB>) -> QueryResult<()>;
}
Expand description

An untyped fragment of SQL.

This may be a complete SQL command (such as an update statement without a RETURNING clause), or a subsection (such as our internal types used to represent a WHERE clause). Implementations of ExecuteDsl and LoadQuery will generally require that this trait be implemented.

Required Methods§

source

fn walk_ast<'b>(&'b self, pass: AstPass<'_, 'b, DB>) -> QueryResult<()>

Walk over this QueryFragment for all passes.

This method is where the actual behavior of an AST node is implemented. This method will contain the behavior required for all possible AST passes. See AstPass for more details.

Trait Implementations§

source§

impl<DB> QueryId for dyn QueryFragment<DB>

§

type QueryId = ()

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

const HAS_STATIC_QUERY_ID: bool = false

Can the SQL generated by Self be uniquely identified by its type? 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

Implementations on Foreign Types§

source§

impl<'a, T, DB> QueryFragment<DB> for &'a T
where DB: Backend, T: QueryFragment<DB> + ?Sized,

source§

fn walk_ast<'b>(&'b self, pass: AstPass<'_, 'b, DB>) -> QueryResult<()>

source§

impl<DB: Backend> QueryFragment<DB> for ()

source§

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

source§

impl<T0: QueryFragment<__DB>, T1: QueryFragment<__DB>, T2: QueryFragment<__DB>, T3: QueryFragment<__DB>, T4: QueryFragment<__DB>, T5: QueryFragment<__DB>, T6: QueryFragment<__DB>, T7: QueryFragment<__DB>, T8: QueryFragment<__DB>, T9: QueryFragment<__DB>, T10: QueryFragment<__DB>, T11: QueryFragment<__DB>, T12: QueryFragment<__DB>, T13: QueryFragment<__DB>, T14: QueryFragment<__DB>, T15: QueryFragment<__DB>, __DB: Backend> QueryFragment<__DB> for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15)

source§

fn walk_ast<'b>(&'b self, out: AstPass<'_, 'b, __DB>) -> QueryResult<()>

source§

impl<T0: QueryFragment<__DB>, T1: QueryFragment<__DB>, T2: QueryFragment<__DB>, T3: QueryFragment<__DB>, T4: QueryFragment<__DB>, T5: QueryFragment<__DB>, T6: QueryFragment<__DB>, T7: QueryFragment<__DB>, T8: QueryFragment<__DB>, T9: QueryFragment<__DB>, T10: QueryFragment<__DB>, T11: QueryFragment<__DB>, T12: QueryFragment<__DB>, T13: QueryFragment<__DB>, T14: QueryFragment<__DB>, __DB: Backend> QueryFragment<__DB> for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14)

source§

fn walk_ast<'b>(&'b self, out: AstPass<'_, 'b, __DB>) -> QueryResult<()>

source§

impl<T0: QueryFragment<__DB>, T1: QueryFragment<__DB>, T2: QueryFragment<__DB>, T3: QueryFragment<__DB>, T4: QueryFragment<__DB>, T5: QueryFragment<__DB>, T6: QueryFragment<__DB>, T7: QueryFragment<__DB>, T8: QueryFragment<__DB>, T9: QueryFragment<__DB>, T10: QueryFragment<__DB>, T11: QueryFragment<__DB>, T12: QueryFragment<__DB>, T13: QueryFragment<__DB>, __DB: Backend> QueryFragment<__DB> for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13)

source§

fn walk_ast<'b>(&'b self, out: AstPass<'_, 'b, __DB>) -> QueryResult<()>

source§

impl<T0: QueryFragment<__DB>, T1: QueryFragment<__DB>, T2: QueryFragment<__DB>, T3: QueryFragment<__DB>, T4: QueryFragment<__DB>, T5: QueryFragment<__DB>, T6: QueryFragment<__DB>, T7: QueryFragment<__DB>, T8: QueryFragment<__DB>, T9: QueryFragment<__DB>, T10: QueryFragment<__DB>, T11: QueryFragment<__DB>, T12: QueryFragment<__DB>, __DB: Backend> QueryFragment<__DB> for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12)

source§

fn walk_ast<'b>(&'b self, out: AstPass<'_, 'b, __DB>) -> QueryResult<()>

source§

impl<T0: QueryFragment<__DB>, T1: QueryFragment<__DB>, T2: QueryFragment<__DB>, T3: QueryFragment<__DB>, T4: QueryFragment<__DB>, T5: QueryFragment<__DB>, T6: QueryFragment<__DB>, T7: QueryFragment<__DB>, T8: QueryFragment<__DB>, T9: QueryFragment<__DB>, T10: QueryFragment<__DB>, T11: QueryFragment<__DB>, __DB: Backend> QueryFragment<__DB> for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11)

source§

fn walk_ast<'b>(&'b self, out: AstPass<'_, 'b, __DB>) -> QueryResult<()>

source§

impl<T0: QueryFragment<__DB>, T1: QueryFragment<__DB>, T2: QueryFragment<__DB>, T3: QueryFragment<__DB>, T4: QueryFragment<__DB>, T5: QueryFragment<__DB>, T6: QueryFragment<__DB>, T7: QueryFragment<__DB>, T8: QueryFragment<__DB>, T9: QueryFragment<__DB>, T10: QueryFragment<__DB>, __DB: Backend> QueryFragment<__DB> for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10)

source§

fn walk_ast<'b>(&'b self, out: AstPass<'_, 'b, __DB>) -> QueryResult<()>

source§

impl<T0: QueryFragment<__DB>, T1: QueryFragment<__DB>, T2: QueryFragment<__DB>, T3: QueryFragment<__DB>, T4: QueryFragment<__DB>, T5: QueryFragment<__DB>, T6: QueryFragment<__DB>, T7: QueryFragment<__DB>, T8: QueryFragment<__DB>, T9: QueryFragment<__DB>, __DB: Backend> QueryFragment<__DB> for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9)

source§

fn walk_ast<'b>(&'b self, out: AstPass<'_, 'b, __DB>) -> QueryResult<()>

source§

impl<T0: QueryFragment<__DB>, T1: QueryFragment<__DB>, T2: QueryFragment<__DB>, T3: QueryFragment<__DB>, T4: QueryFragment<__DB>, T5: QueryFragment<__DB>, T6: QueryFragment<__DB>, T7: QueryFragment<__DB>, T8: QueryFragment<__DB>, __DB: Backend> QueryFragment<__DB> for (T0, T1, T2, T3, T4, T5, T6, T7, T8)

source§

fn walk_ast<'b>(&'b self, out: AstPass<'_, 'b, __DB>) -> QueryResult<()>

source§

impl<T0: QueryFragment<__DB>, T1: QueryFragment<__DB>, T2: QueryFragment<__DB>, T3: QueryFragment<__DB>, T4: QueryFragment<__DB>, T5: QueryFragment<__DB>, T6: QueryFragment<__DB>, T7: QueryFragment<__DB>, __DB: Backend> QueryFragment<__DB> for (T0, T1, T2, T3, T4, T5, T6, T7)

source§

fn walk_ast<'b>(&'b self, out: AstPass<'_, 'b, __DB>) -> QueryResult<()>

source§

impl<T0: QueryFragment<__DB>, T1: QueryFragment<__DB>, T2: QueryFragment<__DB>, T3: QueryFragment<__DB>, T4: QueryFragment<__DB>, T5: QueryFragment<__DB>, T6: QueryFragment<__DB>, __DB: Backend> QueryFragment<__DB> for (T0, T1, T2, T3, T4, T5, T6)

source§

fn walk_ast<'b>(&'b self, out: AstPass<'_, 'b, __DB>) -> QueryResult<()>

source§

impl<T0: QueryFragment<__DB>, T1: QueryFragment<__DB>, T2: QueryFragment<__DB>, T3: QueryFragment<__DB>, T4: QueryFragment<__DB>, T5: QueryFragment<__DB>, __DB: Backend> QueryFragment<__DB> for (T0, T1, T2, T3, T4, T5)

source§

fn walk_ast<'b>(&'b self, out: AstPass<'_, 'b, __DB>) -> QueryResult<()>

source§

impl<T0: QueryFragment<__DB>, T1: QueryFragment<__DB>, T2: QueryFragment<__DB>, T3: QueryFragment<__DB>, T4: QueryFragment<__DB>, __DB: Backend> QueryFragment<__DB> for (T0, T1, T2, T3, T4)

source§

fn walk_ast<'b>(&'b self, out: AstPass<'_, 'b, __DB>) -> QueryResult<()>

source§

impl<T0: QueryFragment<__DB>, T1: QueryFragment<__DB>, T2: QueryFragment<__DB>, T3: QueryFragment<__DB>, __DB: Backend> QueryFragment<__DB> for (T0, T1, T2, T3)

source§

fn walk_ast<'b>(&'b self, out: AstPass<'_, 'b, __DB>) -> QueryResult<()>

source§

impl<T0: QueryFragment<__DB>, T1: QueryFragment<__DB>, T2: QueryFragment<__DB>, __DB: Backend> QueryFragment<__DB> for (T0, T1, T2)

source§

fn walk_ast<'b>(&'b self, out: AstPass<'_, 'b, __DB>) -> QueryResult<()>

source§

impl<T0: QueryFragment<__DB>, T1: QueryFragment<__DB>, __DB: Backend> QueryFragment<__DB> for (T0, T1)

source§

fn walk_ast<'b>(&'b self, out: AstPass<'_, 'b, __DB>) -> QueryResult<()>

source§

impl<T0: QueryFragment<__DB>, __DB: Backend> QueryFragment<__DB> for (T0,)

source§

fn walk_ast<'b>(&'b self, out: AstPass<'_, 'b, __DB>) -> QueryResult<()>

source§

impl<T, DB> QueryFragment<DB> for Option<T>
where DB: Backend, T: QueryFragment<DB>,

source§

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

source§

impl<T, DB> QueryFragment<DB> for Box<T>
where DB: Backend, T: QueryFragment<DB> + ?Sized,

source§

fn walk_ast<'b>(&'b self, pass: AstPass<'_, 'b, DB>) -> QueryResult<()>

Implementors§

source§

impl<'a, C> QueryFragment<Pg> for TransactionBuilder<'a, C>

Available on crate feature postgres_backend only.
source§

impl<DB, Inner> QueryFragment<DB> for SqlQuery<Inner>
where DB: Backend + DieselReserveSpecialization, Inner: QueryFragment<DB>,

source§

impl<DB, Query> QueryFragment<DB> for BoxedSqlQuery<'_, DB, Query>
where DB: Backend + DieselReserveSpecialization, Query: QueryFragment<DB>,

source§

impl<DB: Backend> QueryFragment<DB> for now

source§

impl<DB: Backend> QueryFragment<DB> for today

source§

impl<Query, Value, DB> QueryFragment<DB> for UncheckedBind<Query, Value>
where DB: Backend, Query: QueryFragment<DB>, Value: QueryFragment<DB>,

source§

impl<S> QueryFragment<Pg> for Only<S>
where S: QueryFragment<Pg>,

Available on crate feature postgres_backend only.
source§

impl<S, C, DB> QueryFragment<DB> for AliasedField<S, C>
where S: AliasSource, DB: Backend, C: Column<Table = S::Target>,

source§

impl<S, DB> QueryFragment<DB> for Alias<S>
where S: AliasSource, DB: Backend, S::Target: QueryFragment<DB>,

source§

impl<ST, T, DB> QueryFragment<DB> for SqlLiteral<ST, T>
where DB: Backend, T: QueryFragment<DB>,

source§

impl<T> QueryFragment<Pg> for DistinctOnClause<T>
where T: QueryFragment<Pg>,

Available on crate feature postgres_backend only.
source§

impl<T, U, Op, Ret, DB> QueryFragment<DB> for InsertStatement<T, U, Op, Ret>
where DB: Backend + DieselReserveSpecialization, T: Table, T::FromClause: QueryFragment<DB>, U: QueryFragment<DB> + CanInsertInSingleQuery<DB>, Op: QueryFragment<DB>, Ret: QueryFragment<DB>,

source§

impl<T, U, Ret, DB> QueryFragment<DB> for DeleteStatement<T, U, Ret>
where DB: Backend + DieselReserveSpecialization, T: Table, FromClause<T>: QueryFragment<DB>, U: QueryFragment<DB>, Ret: QueryFragment<DB>,

source§

impl<T, U, V, Ret, DB> QueryFragment<DB> for UpdateStatement<T, U, V, Ret>
where DB: Backend + DieselReserveSpecialization, T: Table, T::FromClause: QueryFragment<DB>, U: QueryFragment<DB>, V: QueryFragment<DB>, Ret: QueryFragment<DB>,