Trait diesel::query_builder::AsQuery
source · pub trait AsQuery {
type SqlType;
type Query: Query<SqlType = Self::SqlType>;
// Required method
fn as_query(self) -> Self::Query;
}
Expand description
Types that can be converted into a complete, typed SQL query.
This is used internally to automatically add the right select clause when
none is specified, or to automatically add RETURNING *
in certain contexts.
A type which implements this trait is guaranteed to be valid for execution.
Required Associated Types§
Required Methods§
Implementors§
source§impl<S> AsQuery for Alias<S>where
S: AliasSource,
S::Target: AsQuery,
Self: QuerySource,
<Self as QuerySource>::DefaultSelection: ValidGrouping<()>,
impl<S> AsQuery for Alias<S>where S: AliasSource, S::Target: AsQuery, Self: QuerySource, <Self as QuerySource>::DefaultSelection: ValidGrouping<()>,
type SqlType = <<Alias<S> as QuerySource>::DefaultSelection as Expression>::SqlType
type Query = SelectStatement<FromClause<Alias<S>>, DefaultSelectClause<FromClause<Alias<S>>>, NoDistinctClause, NoWhereClause, NoOrderClause, LimitOffsetClause<NoLimitClause, NoOffsetClause>, NoGroupByClause, NoHavingClause, NoLockingClause>
source§impl<S> AsQuery for Only<S>where
S: Table + Clone,
<S as QuerySource>::DefaultSelection: ValidGrouping<()> + SelectableExpression<Only<S>>,
Available on crate feature postgres_backend
only.
impl<S> AsQuery for Only<S>where S: Table + Clone, <S as QuerySource>::DefaultSelection: ValidGrouping<()> + SelectableExpression<Only<S>>,
Available on crate feature
postgres_backend
only.