Trait diesel:: query_builder:: QueryFragment
[−]
[src]
pub trait QueryFragment<DB: Backend> { fn to_sql(&self, out: &mut DB::QueryBuilder) -> BuildQueryResult; fn collect_binds(&self, out: &mut DB::BindCollector) -> QueryResult<()>; fn is_safe_to_cache_prepared(&self) -> bool; }
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). All methods on
Connection
that execute a query require this
trait to be implemented.
Required Methods
fn to_sql(&self, out: &mut DB::QueryBuilder) -> BuildQueryResult
fn collect_binds(&self, out: &mut DB::BindCollector) -> QueryResult<()>
fn is_safe_to_cache_prepared(&self) -> bool
Trait Implementations
impl<DB> QueryId for QueryFragment<DB>
Implementors
impl<'a, ST, QS, DB> QueryFragment<DB> for BoxedSelectStatement<'a, ST, QS, DB> where DB: Backend, QS: QuerySource, QS::FromClause: QueryFragment<DB>
impl<DB: Backend> QueryFragment<DB> for NoWhereClause
impl<DB, Expr> QueryFragment<DB> for WhereClause<Expr> where DB: Backend, Expr: QueryFragment<DB>
impl<T, U, DB> QueryFragment<DB> for InsertStatement<T, U> where DB: Backend, T: Table, T::FromClause: QueryFragment<DB>, U: Insertable<T, DB> + Copy
impl<T, U, DB> QueryFragment<DB> for UpdateStatement<T, U> where DB: Backend, T: UpdateTarget, T::WhereClause: QueryFragment<DB>, T::FromClause: QueryFragment<DB>, U: Changeset<DB>
impl<T: ?Sized, DB> QueryFragment<DB> for Box<T> where DB: Backend, T: QueryFragment<DB>
impl<'a, T: ?Sized, DB> QueryFragment<DB> for &'a T where DB: Backend, T: QueryFragment<DB>
impl<DB: Backend> QueryFragment<DB> for ()
impl<ST, DB> QueryFragment<DB> for SqlLiteral<ST> where DB: Backend + HasSqlType<ST>