pub trait AsInExpression<T: SqlType + TypedExpressionType> {
type InExpression: MaybeEmpty + Expression<SqlType = T>;
// Required method
fn as_in_expression(self) -> Self::InExpression;
}
Expand description
This trait describes how a type is transformed to the
IN (values)
value expression
Diesel provided several implementations here:
- An implementation for any
Iterator
over values that implementAsExpression<ST>
for the corresponding sql type ST. The corresponding values clause will contain bind statements for each individual value. - An implementation for select statements, that returns a single field. The corresponding values clause will contain the sub query.
This trait is exposed for custom third party backends so
that they can restrict the QueryFragment
implementations
for In
and NotIn
.
Required Associated Types§
sourcetype InExpression: MaybeEmpty + Expression<SqlType = T>
type InExpression: MaybeEmpty + Expression<SqlType = T>
Type of the expression returned by AsInExpression::as_in_expression
Required Methods§
sourcefn as_in_expression(self) -> Self::InExpression
fn as_in_expression(self) -> Self::InExpression
Construct the diesel query dsl representation of
the IN (values)
clause for the given type