Skip to main content

SQLExpr

Struct SQLExpr 

Source
pub struct SQLExpr<'a, V: SQLParam, T: DataType, N: Nullability = NonNull, A: AggregateKind = Scalar, S = ()> { /* private fields */ }
Expand description

A SQL fragment together with its type information.

Every function in crate::expr returns an SQLExpr. The type parameters record what the fragment produces:

  • 'a: lifetime of borrowed values inside it;
  • V: the dialect’s value type (SQLiteValue, PostgresValue, …);
  • T: the SQL data type marker;
  • N: NonNull or Null;
  • A: Scalar or Agg;
  • S: the tables it reads (see crate::scope).

SQLExpr dereferences to SQL, so methods such as SQL::sql work on it directly. The Rust operators + - * / % and unary - do arithmetic on numeric expressions, and & | ! combine boolean ones.

§Examples

let total = users.age.clone() * 2 + 1;
assert_eq!(total.sql(), r#""users"."age" * ? + ?"#);

Implementations§

Source§

impl<'a, V: SQLParam, T: DataType, N: Nullability, A: AggregateKind, S> SQLExpr<'a, V, T, N, A, S>

Source

pub const fn new(sql: SQL<'a, V>) -> Self

Wraps a SQL fragment, declaring its type.

The type parameters are trusted, not checked against the SQL.

Source

pub fn into_sql(self) -> SQL<'a, V>

Returns the SQL fragment, dropping the type information.

Source

pub fn nullable(self) -> SQLExpr<'a, V, T, Null, A, S>

Marks this expression as nullable, keeping its SQL type and aggregate kind.

Source

pub fn unscoped(self) -> SQLExpr<'a, V, T, N, A>

Forgets which tables this expression reads.

The result passes every scope check. Use it only for SQL that is valid in a scope the type system cannot see, such as a correlated subquery built separately from its outer query.

Source§

impl<'a, V, T, N, S> SQLExpr<'a, V, T, N, Agg, S>
where V: SQLParam + 'a, T: DataType, N: Nullability,

Source

pub fn over<W>( self, spec: WindowSpec<'a, V, W>, ) -> SQLExpr<'a, V, T, N, Scalar, (S, W)>

Turns this aggregate into a window function (agg OVER (...)).

The result keeps the SQL type and nullability but is scalar, so it can be selected next to plain columns.

§Examples
let per_name = sum(users.score).over(window().partition_by([users.name]));
assert_eq!(
    per_name.sql(),
    r#"SUM ("users"."score") OVER (PARTITION BY "users"."name")"#
);
Source

pub fn filter<C>( self, condition: C, ) -> SQLExpr<'a, V, T, N, Agg, (S, ScopeOnly<C::Sources>)>

Limits the rows an aggregate sees (agg FILTER (WHERE condition)), on SQLite and PostgreSQL.

The condition must be boolean. The result is still an aggregate.

§Examples
let adults = count(users.id).filter(gt(users.age, 18));
assert_eq!(
    adults.sql(),
    r#"COUNT ("users"."id") FILTER (WHERE "users"."age" > ?)"#
);

Methods from Deref<Target = SQL<'a, V>>§

Source

pub fn is_subquery(&self) -> bool

Returns true if the fragment starts with a SELECT or WITH token.

Source

pub fn sql(&self) -> String

Renders the SQL text.

Placeholders follow the dialect of V: $1, $2, ... for PostgreSQL, :name (named) or ? for SQLite, and ? for MySQL. Use SQL::build to get the parameters in the same pass.

Source

pub fn has_returning(&self) -> bool

Whether this statement has a RETURNING clause (outside any parentheses), so it returns rows although it changes data.

Source

pub fn inline_sql(&self) -> Option<String>

Renders the SQL text with every bound value written as a literal instead of a placeholder.

For statements that cannot take parameters, such as the body of a CREATE VIEW. Returns None when a placeholder has no bound value, or a value has no literal form in this dialect (see SQLParam::write_literal).

Source

pub fn build(&self) -> (String, SmallVec<[&V; 8]>)

Renders the SQL text and collects the bound values in one pass.

Drivers use this to execute a statement. Placeholders without a bound value are rendered but not collected. For SQLite, a named placeholder that appears more than once is collected once, since SQLite gives each distinct :name a single slot.

§Examples
use drizzle_core::SQL;

let sql = SQL::raw("SELECT").append(SQL::param(Value(1)));
let (text, params) = sql.build();
assert_eq!(text, "SELECT ?");
assert_eq!(params.as_slice(), [&Value(1)]);
Source

pub fn build_with(&self, style: ParamStyle) -> (String, SmallVec<[&V; 8]>)

Like build, but with a caller-chosen placeholder style.

For drivers that speak the dialect but bind parameters differently, such as the AWS Data API on PostgreSQL, which needs :1, :2, ... instead of $1, $2, ....

Source

pub fn write_to(&self, buf: &mut impl Write)

Writes the SQL text to buf, like SQL::sql without allocating a new string.

Source

pub fn write_to_with(&self, buf: &mut impl Write, style: ParamStyle)

Like write_to, but with a caller-chosen placeholder style.

Source

pub fn write_chunk_to( &self, buf: &mut impl Write, chunk: &SQLChunk<'a, V>, index: usize, )

Writes the chunk at index to buf, expanding an empty SELECT projection that ends at this chunk.

Does not write the space that may follow the chunk.

Source

pub fn params(&self) -> impl Iterator<Item = &V> + use<'_, V>

Returns the bound values, in order. Placeholders without a value are skipped.

Trait Implementations§

Source§

impl<'a, V, T, N, A, S, Rhs> Add<Rhs> for SQLExpr<'a, V, T, N, A, S>
where V: SQLParam + 'a, T: ArithmeticOutput<Rhs::SQLType, AddOp>, N: Nullability, A: AggregateKind, Rhs: Expr<'a, V>, Rhs::SQLType: Numeric, Rhs::Nullable: Nullability, <T as ArithmeticOutput<Rhs::SQLType, AddOp>>::Nullability: ResolveArithmeticNullability<N, Rhs::Nullable>,

Source§

type Output = SQLExpr<'a, V, <T as ArithmeticOutput<<Rhs as Expr<'a, V>>::SQLType, AddOp>>::Output, <<T as ArithmeticOutput<<Rhs as Expr<'a, V>>::SQLType, AddOp>>::Nullability as ResolveArithmeticNullability<N, <Rhs as Expr<'a, V>>::Nullable>>::Output, <A as AggregateKind>::Or<<Rhs as Expr<'a, V>>::Aggregate>, (S, <Rhs as ExprSources>::Sources)>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: Rhs) -> Self::Output

Performs the + operation. Read more
Source§

impl<'a, V, T, N, A, S> AsRef<SQL<'a, V>> for SQLExpr<'a, V, T, N, A, S>

Borrows the inner SQL.

Source§

fn as_ref(&self) -> &SQL<'a, V>

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl<'a, V, T, N, A, S, Rhs> BitAnd<Rhs> for SQLExpr<'a, V, T, N, A, S>
where V: SQLParam + 'a, T: BooleanLike, N: Nullability, A: AggregateKind, Rhs: Expr<'a, V>, Rhs::SQLType: BooleanLike, Rhs::Nullable: Nullability,

left & right renders (left AND right); see and.

Source§

type Output = SQLExpr<'a, V, <<V as SQLParam>::DialectMarker as DialectTypes>::Bool, <N as Nullability>::Or<<Rhs as Expr<'a, V>>::Nullable>, <A as AggregateKind>::Or<<Rhs as Expr<'a, V>>::Aggregate>, (S, <Rhs as ExprSources>::Sources)>

The resulting type after applying the & operator.
Source§

fn bitand(self, rhs: Rhs) -> Self::Output

Performs the & operation. Read more
Source§

impl<'a, V, T, N, A, S, Rhs> BitOr<Rhs> for SQLExpr<'a, V, T, N, A, S>
where V: SQLParam + 'a, T: BooleanLike, N: Nullability, A: AggregateKind, Rhs: Expr<'a, V>, Rhs::SQLType: BooleanLike, Rhs::Nullable: Nullability,

left | right renders (left OR right); see or.

Source§

type Output = SQLExpr<'a, V, <<V as SQLParam>::DialectMarker as DialectTypes>::Bool, <N as Nullability>::Or<<Rhs as Expr<'a, V>>::Nullable>, <A as AggregateKind>::Or<<Rhs as Expr<'a, V>>::Aggregate>, (S, <Rhs as ExprSources>::Sources)>

The resulting type after applying the | operator.
Source§

fn bitor(self, rhs: Rhs) -> Self::Output

Performs the | operation. Read more
Source§

impl<'a, V: Clone + SQLParam, T: Clone + DataType, N: Clone + Nullability, A: Clone + AggregateKind, S: Clone> Clone for SQLExpr<'a, V, T, N, A, S>

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<'a, V: Debug + SQLParam, T: Debug + DataType, N: Debug + Nullability, A: Debug + AggregateKind, S: Debug> Debug for SQLExpr<'a, V, T, N, A, S>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'a, V, T, N, A, S> Deref for SQLExpr<'a, V, T, N, A, S>

Gives direct access to the inner SQL and its methods, such as SQL::sql.

Source§

type Target = SQL<'a, V>

The resulting type after dereferencing.
Source§

fn deref(&self) -> &Self::Target

Dereferences the value.
Source§

impl<V, T, N, A, S> Display for SQLExpr<'_, V, T, N, A, S>

Formats the expression like its inner SQL.

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'a, V, T, N, A, S, Rhs> Div<Rhs> for SQLExpr<'a, V, T, N, A, S>
where V: SQLParam + 'a, T: ArithmeticOutput<Rhs::SQLType, DivOp>, N: Nullability, A: AggregateKind, Rhs: Expr<'a, V>, Rhs::SQLType: Numeric, Rhs::Nullable: Nullability, <T as ArithmeticOutput<Rhs::SQLType, DivOp>>::Nullability: ResolveArithmeticNullability<N, Rhs::Nullable>,

Source§

type Output = SQLExpr<'a, V, <T as ArithmeticOutput<<Rhs as Expr<'a, V>>::SQLType, DivOp>>::Output, <<T as ArithmeticOutput<<Rhs as Expr<'a, V>>::SQLType, DivOp>>::Nullability as ResolveArithmeticNullability<N, <Rhs as Expr<'a, V>>::Nullable>>::Output, <A as AggregateKind>::Or<<Rhs as Expr<'a, V>>::Aggregate>, (S, <Rhs as ExprSources>::Sources)>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: Rhs) -> Self::Output

Performs the / operation. Read more
Source§

impl<'a, V: SQLParam, T: DataType, N: Nullability, A: AggregateKind, S> Expr<'a, V> for SQLExpr<'a, V, T, N, A, S>

Source§

type SQLType = T

The SQL data type this expression evaluates to.
Source§

type Nullable = N

Whether this expression can be NULL.
Source§

type Aggregate = A

Whether this is an aggregate (COUNT, SUM) or scalar expression.
Source§

fn to_expr_sql(&self) -> SQL<'a, V>

Renders this value as a scalar expression, borrowing it. Read more
Source§

fn into_expr_sql(self) -> SQL<'a, V>
where Self: Sized,

Renders this value as a scalar expression, consuming it.
Source§

fn to_condition_sql(&self) -> Option<SQL<'a, V>>

Renders this value as one element of a ConditionList. Read more
Source§

fn into_condition_sql(self) -> Option<SQL<'a, V>>
where Self: Sized,

Consuming counterpart of Expr::to_condition_sql.
Source§

impl<V: SQLParam, T: DataType, N: Nullability, A: AggregateKind, S> ExprSources for SQLExpr<'_, V, T, N, A, S>

Source§

type Sources = S

Type-level tree with one Src leaf per column read.
Source§

impl<V: SQLParam, T, N, A, S> ExprValueType for SQLExpr<'_, V, T, N, A, S>

Source§

type ValueType = <N as WrapNullable<<T as SQLTypeToRust<<V as SQLParam>::DialectMarker>>::RustType>>::Output

The decoded Rust type.
Source§

impl<'a, V: SQLParam, T: DataType, N: Nullability, A: AggregateKind, S> From<SQLExpr<'a, V, T, N, A, S>> for SQL<'a, V>

Source§

fn from(expr: SQLExpr<'a, V, T, N, A, S>) -> Self

Converts to this type from the input type.
Source§

impl<V: SQLParam, T, N, A, S> GroupByIdentity for SQLExpr<'_, V, T, N, A, S>

Source§

type Identity = SQLExpr<'_, V, T, N, A, S>

The type looked up in the grouped column list.
Source§

impl<V, T, N, A, S> HasAggStatus for SQLExpr<'_, V, T, N, A, S>

Source§

impl<V: SQLParam, T, N, A, S> IntoSelectTarget for SQLExpr<'_, V, T, N, A, S>

select(typed_expr) → SelectCols<(Expr,)> — single typed expression.

Source§

type Marker = SelectCols<(SQLExpr<'_, V, T, N, A, S>,)>

The select marker.
Source§

impl<'a, V, T, N, A, S, Rhs> Mul<Rhs> for SQLExpr<'a, V, T, N, A, S>
where V: SQLParam + 'a, T: ArithmeticOutput<Rhs::SQLType, MulOp>, N: Nullability, A: AggregateKind, Rhs: Expr<'a, V>, Rhs::SQLType: Numeric, Rhs::Nullable: Nullability, <T as ArithmeticOutput<Rhs::SQLType, MulOp>>::Nullability: ResolveArithmeticNullability<N, Rhs::Nullable>,

Source§

type Output = SQLExpr<'a, V, <T as ArithmeticOutput<<Rhs as Expr<'a, V>>::SQLType, MulOp>>::Output, <<T as ArithmeticOutput<<Rhs as Expr<'a, V>>::SQLType, MulOp>>::Nullability as ResolveArithmeticNullability<N, <Rhs as Expr<'a, V>>::Nullable>>::Output, <A as AggregateKind>::Or<<Rhs as Expr<'a, V>>::Aggregate>, (S, <Rhs as ExprSources>::Sources)>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: Rhs) -> Self::Output

Performs the * operation. Read more
Source§

impl<'a, V, T, N, A, S> Neg for SQLExpr<'a, V, T, N, A, S>
where V: SQLParam + 'a, T: Numeric + NegOutput, N: Nullability, A: AggregateKind,

Source§

type Output = SQLExpr<'a, V, <T as NegOutput>::Output, N, A, S>

The resulting type after applying the - operator.
Source§

fn neg(self) -> Self::Output

Performs the unary - operation. Read more
Source§

impl<'a, V, T, N, A, S> Not for SQLExpr<'a, V, T, N, A, S>
where V: SQLParam + 'a, T: BooleanLike, N: Nullability, A: AggregateKind,

!expr renders NOT (expr); see not.

Source§

type Output = SQLExpr<'a, V, <<V as SQLParam>::DialectMarker as DialectTypes>::Bool, N, A, S>

The resulting type after applying the ! operator.
Source§

fn not(self) -> Self::Output

Performs the unary ! operation. Read more
Source§

impl<'a, V, T, N, A, S, Rhs> Rem<Rhs> for SQLExpr<'a, V, T, N, A, S>
where V: SQLParam + 'a, T: ArithmeticOutput<Rhs::SQLType, RemOp>, N: Nullability, A: AggregateKind, Rhs: Expr<'a, V>, Rhs::SQLType: Numeric, Rhs::Nullable: Nullability, <T as ArithmeticOutput<Rhs::SQLType, RemOp>>::Nullability: ResolveArithmeticNullability<N, Rhs::Nullable>,

Source§

type Output = SQLExpr<'a, V, <T as ArithmeticOutput<<Rhs as Expr<'a, V>>::SQLType, RemOp>>::Output, <<T as ArithmeticOutput<<Rhs as Expr<'a, V>>::SQLType, RemOp>>::Nullability as ResolveArithmeticNullability<N, <Rhs as Expr<'a, V>>::Nullable>>::Output, <A as AggregateKind>::Or<<Rhs as Expr<'a, V>>::Aggregate>, (S, <Rhs as ExprSources>::Sources)>

The resulting type after applying the % operator.
Source§

fn rem(self, rhs: Rhs) -> Self::Output

Performs the % operation. Read more
Source§

impl<'a, V, T, N, A, S, Rhs> Sub<Rhs> for SQLExpr<'a, V, T, N, A, S>
where V: SQLParam + 'a, T: ArithmeticOutput<Rhs::SQLType, SubOp>, N: Nullability, A: AggregateKind, Rhs: Expr<'a, V>, Rhs::SQLType: Numeric, Rhs::Nullable: Nullability, <T as ArithmeticOutput<Rhs::SQLType, SubOp>>::Nullability: ResolveArithmeticNullability<N, Rhs::Nullable>,

Source§

type Output = SQLExpr<'a, V, <T as ArithmeticOutput<<Rhs as Expr<'a, V>>::SQLType, SubOp>>::Output, <<T as ArithmeticOutput<<Rhs as Expr<'a, V>>::SQLType, SubOp>>::Nullability as ResolveArithmeticNullability<N, <Rhs as Expr<'a, V>>::Nullable>>::Output, <A as AggregateKind>::Or<<Rhs as Expr<'a, V>>::Aggregate>, (S, <Rhs as ExprSources>::Sources)>

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: Rhs) -> Self::Output

Performs the - operation. Read more
Source§

impl<'a, V: SQLParam, T: DataType, N: Nullability, A: AggregateKind, S> ToSQL<'a, V> for SQLExpr<'a, V, T, N, A, S>

Source§

fn to_sql(&self) -> SQL<'a, V>

Renders self as a SQL fragment.
Source§

fn into_sql(self) -> SQL<'a, V>

Renders self as a SQL fragment, consuming it. Read more

Auto Trait Implementations§

§

impl<'a, V, T, N, A, S> Freeze for SQLExpr<'a, V, T, N, A, S>
where SQL<'a, V>: Freeze, PhantomData<fn() -> (T, N, A, S)>: Freeze,

§

impl<'a, V, T, N, A, S> RefUnwindSafe for SQLExpr<'a, V, T, N, A, S>

§

impl<'a, V, T, N, A, S> Send for SQLExpr<'a, V, T, N, A, S>
where SQL<'a, V>: Send, PhantomData<fn() -> (T, N, A, S)>: Send,

§

impl<'a, V, T, N, A, S> Sync for SQLExpr<'a, V, T, N, A, S>
where SQL<'a, V>: Sync, PhantomData<fn() -> (T, N, A, S)>: Sync,

§

impl<'a, V, T, N, A, S> Unpin for SQLExpr<'a, V, T, N, A, S>
where SQL<'a, V>: Unpin, PhantomData<fn() -> (T, N, A, S)>: Unpin,

§

impl<'a, V, T, N, A, S> UnsafeUnpin for SQLExpr<'a, V, T, N, A, S>

§

impl<'a, V, T, N, A, S> UnwindSafe for SQLExpr<'a, V, T, N, A, S>

Blanket Implementations§

Source§

impl<T> AliasExt for T
where T: ExprValueType,

Source§

fn alias(self, name: &'static str) -> AliasedExpr<Self>

Renames this expression: expr AS "name".
Source§

fn named<Name: Tag>(self) -> NamedExpr<Self, Name>

Names this expression with a type-level Tag, rendered as expr AS "<Tag::NAME>".
Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<'a, V, L, R> ComparisonOperand<'a, V, L> for R
where V: SQLParam + 'a, L: Expr<'a, V>, R: Expr<'a, V>, <L as Expr<'a, V>>::SQLType: Compatible<<R as Expr<'a, V>>::SQLType>,

Source§

type SQLType = <R as Expr<'a, V>>::SQLType

SQL type of the operand.
Source§

type Nullable = <R as Expr<'a, V>>::Nullable

Whether the operand can be NULL.
Source§

type Aggregate = <R as Expr<'a, V>>::Aggregate

Whether the operand is an aggregate.
Source§

type Sources = <R as ExprSources>::Sources

Tables the operand reads; see ExprSources::Sources.
Source§

fn into_comparison_sql(self) -> SQL<'a, V>

Renders the operand.
Source§

impl<'a, V, E> ExprExt<'a, V> for E
where V: SQLParam, E: Expr<'a, V>,

Source§

fn eq<R>( self, other: R, ) -> SQLExpr<'a, V, <V::DialectMarker as DialectTypes>::Bool, NonNull, <Self::Aggregate as AggregateKind>::Or<<R as ComparisonOperand<'a, V, Self>>::Aggregate>, (Arg<<Self as Expr<'a, V>>::Nullable, <Self as ExprSources>::Sources>, Arg<<R as ComparisonOperand<'a, V, Self>>::Nullable, <R as ComparisonOperand<'a, V, Self>>::Sources>)>
where R: ComparisonOperand<'a, V, Self>, Self::SQLType: Compatible<<R as ComparisonOperand<'a, V, Self>>::SQLType>,

Equality comparison (=); see eq.
Source§

fn ne<R>( self, other: R, ) -> SQLExpr<'a, V, <V::DialectMarker as DialectTypes>::Bool, NonNull, <Self::Aggregate as AggregateKind>::Or<<R as ComparisonOperand<'a, V, Self>>::Aggregate>, (Arg<<Self as Expr<'a, V>>::Nullable, <Self as ExprSources>::Sources>, Arg<<R as ComparisonOperand<'a, V, Self>>::Nullable, <R as ComparisonOperand<'a, V, Self>>::Sources>)>
where R: ComparisonOperand<'a, V, Self>, Self::SQLType: Compatible<<R as ComparisonOperand<'a, V, Self>>::SQLType>,

Inequality comparison (<>); see ne.
Source§

fn gt<R>( self, other: R, ) -> SQLExpr<'a, V, <V::DialectMarker as DialectTypes>::Bool, NonNull, <Self::Aggregate as AggregateKind>::Or<<R as ComparisonOperand<'a, V, Self>>::Aggregate>, (Arg<<Self as Expr<'a, V>>::Nullable, <Self as ExprSources>::Sources>, Arg<<R as ComparisonOperand<'a, V, Self>>::Nullable, <R as ComparisonOperand<'a, V, Self>>::Sources>)>
where R: ComparisonOperand<'a, V, Self>, Self::SQLType: Compatible<<R as ComparisonOperand<'a, V, Self>>::SQLType>,

Greater-than comparison (>); see gt.
Source§

fn ge<R>( self, other: R, ) -> SQLExpr<'a, V, <V::DialectMarker as DialectTypes>::Bool, NonNull, <Self::Aggregate as AggregateKind>::Or<<R as ComparisonOperand<'a, V, Self>>::Aggregate>, (Arg<<Self as Expr<'a, V>>::Nullable, <Self as ExprSources>::Sources>, Arg<<R as ComparisonOperand<'a, V, Self>>::Nullable, <R as ComparisonOperand<'a, V, Self>>::Sources>)>
where R: ComparisonOperand<'a, V, Self>, Self::SQLType: Compatible<<R as ComparisonOperand<'a, V, Self>>::SQLType>,

Greater-than-or-equal comparison (>=); see gte.
Source§

fn lt<R>( self, other: R, ) -> SQLExpr<'a, V, <V::DialectMarker as DialectTypes>::Bool, NonNull, <Self::Aggregate as AggregateKind>::Or<<R as ComparisonOperand<'a, V, Self>>::Aggregate>, (Arg<<Self as Expr<'a, V>>::Nullable, <Self as ExprSources>::Sources>, Arg<<R as ComparisonOperand<'a, V, Self>>::Nullable, <R as ComparisonOperand<'a, V, Self>>::Sources>)>
where R: ComparisonOperand<'a, V, Self>, Self::SQLType: Compatible<<R as ComparisonOperand<'a, V, Self>>::SQLType>,

Less-than comparison (<); see lt.
Source§

fn le<R>( self, other: R, ) -> SQLExpr<'a, V, <V::DialectMarker as DialectTypes>::Bool, NonNull, <Self::Aggregate as AggregateKind>::Or<<R as ComparisonOperand<'a, V, Self>>::Aggregate>, (Arg<<Self as Expr<'a, V>>::Nullable, <Self as ExprSources>::Sources>, Arg<<R as ComparisonOperand<'a, V, Self>>::Nullable, <R as ComparisonOperand<'a, V, Self>>::Sources>)>
where R: ComparisonOperand<'a, V, Self>, Self::SQLType: Compatible<<R as ComparisonOperand<'a, V, Self>>::SQLType>,

Less-than-or-equal comparison (<=); see lte.
Source§

fn like<R>( self, pattern: R, ) -> SQLExpr<'a, V, <V::DialectMarker as DialectTypes>::Bool, NonNull, <Self::Aggregate as AggregateKind>::Or<<R as ComparisonOperand<'a, V, Self>>::Aggregate>, (Arg<<Self as Expr<'a, V>>::Nullable, <Self as ExprSources>::Sources>, Arg<<R as ComparisonOperand<'a, V, Self>>::Nullable, <R as ComparisonOperand<'a, V, Self>>::Sources>)>
where R: ComparisonOperand<'a, V, Self>, Self::SQLType: Compatible<<R as ComparisonOperand<'a, V, Self>>::SQLType> + Textual, <R as ComparisonOperand<'a, V, Self>>::SQLType: Textual,

Pattern match (LIKE); see like.
Source§

fn not_like<R>( self, pattern: R, ) -> SQLExpr<'a, V, <V::DialectMarker as DialectTypes>::Bool, NonNull, <Self::Aggregate as AggregateKind>::Or<<R as ComparisonOperand<'a, V, Self>>::Aggregate>, (Arg<<Self as Expr<'a, V>>::Nullable, <Self as ExprSources>::Sources>, Arg<<R as ComparisonOperand<'a, V, Self>>::Nullable, <R as ComparisonOperand<'a, V, Self>>::Sources>)>
where R: ComparisonOperand<'a, V, Self>, Self::SQLType: Compatible<<R as ComparisonOperand<'a, V, Self>>::SQLType> + Textual, <R as ComparisonOperand<'a, V, Self>>::SQLType: Textual,

Negated pattern match (NOT LIKE); see not_like.
Source§

fn is_null( self, ) -> SQLExpr<'a, V, <V::DialectMarker as DialectTypes>::Bool, NonNull, Self::Aggregate, ScopeOnly<Self::Sources>>

NULL check (IS NULL); see is_null.
Source§

fn is_not_null( self, ) -> SQLExpr<'a, V, <V::DialectMarker as DialectTypes>::Bool, NonNull, Self::Aggregate, ScopeOnly<Self::Sources>>

Non-NULL check (IS NOT NULL); see is_not_null.
Source§

fn between<L, H>( self, low: L, high: H, ) -> SQLExpr<'a, V, <V::DialectMarker as DialectTypes>::Bool, NonNull, <<Self::Aggregate as AggregateKind>::Or<<L as ComparisonOperand<'a, V, Self>>::Aggregate> as AggregateKind>::Or<<H as ComparisonOperand<'a, V, Self>>::Aggregate>, (Arg<<Self as Expr<'a, V>>::Nullable, <Self as ExprSources>::Sources>, (Arg<<L as ComparisonOperand<'a, V, Self>>::Nullable, <L as ComparisonOperand<'a, V, Self>>::Sources>, Arg<<H as ComparisonOperand<'a, V, Self>>::Nullable, <H as ComparisonOperand<'a, V, Self>>::Sources>))>
where L: ComparisonOperand<'a, V, Self>, H: ComparisonOperand<'a, V, Self>, Self::SQLType: Compatible<<L as ComparisonOperand<'a, V, Self>>::SQLType> + Compatible<<H as ComparisonOperand<'a, V, Self>>::SQLType>,

Inclusive range check (BETWEEN); see between.
Source§

fn not_between<L, H>( self, low: L, high: H, ) -> SQLExpr<'a, V, <V::DialectMarker as DialectTypes>::Bool, NonNull, <<Self::Aggregate as AggregateKind>::Or<<L as ComparisonOperand<'a, V, Self>>::Aggregate> as AggregateKind>::Or<<H as ComparisonOperand<'a, V, Self>>::Aggregate>, (Arg<<Self as Expr<'a, V>>::Nullable, <Self as ExprSources>::Sources>, (Arg<<L as ComparisonOperand<'a, V, Self>>::Nullable, <L as ComparisonOperand<'a, V, Self>>::Sources>, Arg<<H as ComparisonOperand<'a, V, Self>>::Nullable, <H as ComparisonOperand<'a, V, Self>>::Sources>))>
where L: ComparisonOperand<'a, V, Self>, H: ComparisonOperand<'a, V, Self>, Self::SQLType: Compatible<<L as ComparisonOperand<'a, V, Self>>::SQLType> + Compatible<<H as ComparisonOperand<'a, V, Self>>::SQLType>,

Negated range check (NOT BETWEEN); see not_between.
Source§

fn in_array<I, R>( self, values: I, ) -> SQLExpr<'a, V, <V::DialectMarker as DialectTypes>::Bool, NonNull, Self::Aggregate, (Arg<Self::Nullable, Self::Sources>, Arg<R::Nullable, R::Sources>)>
where I: IntoIterator<Item = R>, R: Expr<'a, V>, Self::SQLType: Compatible<R::SQLType>,

Membership in a list of values (IN (...)); see in_array.
Source§

fn not_in_array<I, R>( self, values: I, ) -> SQLExpr<'a, V, <V::DialectMarker as DialectTypes>::Bool, NonNull, Self::Aggregate, (Arg<Self::Nullable, Self::Sources>, Arg<R::Nullable, R::Sources>)>
where I: IntoIterator<Item = R>, R: Expr<'a, V>, Self::SQLType: Compatible<R::SQLType>,

Non-membership in a list of values (NOT IN (...)); see not_in_array.
Source§

fn in_subquery<S>( self, subquery: S, ) -> SQLExpr<'a, V, <V::DialectMarker as DialectTypes>::Bool, NonNull, Self::Aggregate, (Arg<Self::Nullable, Self::Sources>, Arg<S::Nullable, S::Sources>)>
where S: Expr<'a, V>, Self::SQLType: Compatible<S::SQLType> + Compatible<Self::SQLType>,

Membership in a subquery’s rows (IN (SELECT ...)); see in_subquery.
Source§

fn not_in_subquery<S>( self, subquery: S, ) -> SQLExpr<'a, V, <V::DialectMarker as DialectTypes>::Bool, NonNull, Self::Aggregate, (Arg<Self::Nullable, Self::Sources>, Arg<S::Nullable, S::Sources>)>
where S: Expr<'a, V>, Self::SQLType: Compatible<S::SQLType> + Compatible<Self::SQLType>,

Non-membership in a subquery’s rows (NOT IN (SELECT ...)); see not_in_subquery.
Source§

fn is_distinct_from<R>( self, other: R, ) -> SQLExpr<'a, V, <V::DialectMarker as DialectTypes>::Bool, NonNull, <Self::Aggregate as AggregateKind>::Or<<R as ComparisonOperand<'a, V, Self>>::Aggregate>, ScopeOnly<(<Self as ExprSources>::Sources, <R as ComparisonOperand<'a, V, Self>>::Sources)>>
where R: ComparisonOperand<'a, V, Self>, Self::SQLType: Compatible<<R as ComparisonOperand<'a, V, Self>>::SQLType>,

NULL-safe inequality (IS DISTINCT FROM); see is_distinct_from.
Source§

fn is_not_distinct_from<R>( self, other: R, ) -> SQLExpr<'a, V, <V::DialectMarker as DialectTypes>::Bool, NonNull, <Self::Aggregate as AggregateKind>::Or<<R as ComparisonOperand<'a, V, Self>>::Aggregate>, ScopeOnly<(<Self as ExprSources>::Sources, <R as ComparisonOperand<'a, V, Self>>::Sources)>>
where R: ComparisonOperand<'a, V, Self>, Self::SQLType: Compatible<<R as ComparisonOperand<'a, V, Self>>::SQLType>,

NULL-safe equality (IS NOT DISTINCT FROM); see is_not_distinct_from.
Source§

fn is_true( self, ) -> SQLExpr<'a, V, <V::DialectMarker as DialectTypes>::Bool, NonNull, Self::Aggregate, ScopeOnly<Self::Sources>>

Truth test (IS TRUE); see is_true.
Source§

fn is_false( self, ) -> SQLExpr<'a, V, <V::DialectMarker as DialectTypes>::Bool, NonNull, Self::Aggregate, ScopeOnly<Self::Sources>>

Falsity test (IS FALSE); see is_false.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<List> ListIncludes<Nil, ()> for List

Source§

impl<Mk> MarkerAggValidFor<()> for Mk

Source§

impl<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
Source§

impl<E, Grouped> SingleColGroupCheck<Grouped, AggSkip> for E
where E: HasAggStatus<Status = AllAgg>,

Source§

impl<E, Grouped, W> SingleColGroupCheck<Grouped, ScalarCheck<W>> for E
where E: HasAggStatus<Status = AllScalar> + GroupByIdentity, Grouped: ListContains<<E as GroupByIdentity>::Identity, W>,

Source§

impl<T> ToCompactString for T
where T: Display,

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> TypeEq<T> for T