pub struct SQL<'a, V>where
V: SQLParam,{
pub chunks: SmallVec<[SQLChunk<'a, V>; 8]>,
}Expand description
A SQL fragment: tokens, identifiers, raw text, and bound parameters.
Every query builder and expression renders to a SQL. V is the
driver’s value type (SQLiteValue, PostgresValue, …), which also
fixes the dialect used to render placeholders: ? for SQLite and MySQL,
$1, $2, ... for PostgreSQL.
Chunks are stored inline for short fragments (up to 8) without a heap allocation.
§Examples
use drizzle_core::{SQL, Token};
let sql: SQL<'_, Value> = SQL::raw("SELECT")
.append(SQL::ident("name"))
.push(Token::FROM)
.append(SQL::ident("users"))
.push(Token::WHERE)
.append(SQL::ident("id"))
.push(Token::EQ)
.append(SQL::param(Value(7)));
assert_eq!(sql.sql(), r#"SELECT "name" FROM "users" WHERE "id" = ?"#);
assert_eq!(sql.params().collect::<Vec<_>>(), [&Value(7)]);Fields§
§chunks: SmallVec<[SQLChunk<'a, V>; 8]>The fragment’s chunks, in order.
Implementations§
Source§impl<'a, V> SQL<'a, V>where
V: SQLParam,
impl<'a, V> SQL<'a, V>where
V: SQLParam,
Sourcepub fn token(t: Token) -> SQL<'a, V>
pub fn token(t: Token) -> SQL<'a, V>
Creates a fragment holding one keyword or punctuation Token.
Sourcepub fn with_capacity_chunks(capacity: usize) -> SQL<'a, V>
pub fn with_capacity_chunks(capacity: usize) -> SQL<'a, V>
Creates an empty fragment with room for capacity chunks.
Sourcepub fn ident(name: impl Into<Cow<'a, str>>) -> SQL<'a, V>
pub fn ident(name: impl Into<Cow<'a, str>>) -> SQL<'a, V>
Creates a quoted identifier, such as a table or column name.
The quote character follows the dialect: "name" for SQLite and
PostgreSQL, `name` for MySQL.
§Examples
use drizzle_core::SQL;
assert_eq!(SQL::<Value>::ident("user name").sql(), r#""user name""#);Sourcepub fn columns(columns: &[ColumnRef]) -> SQL<'a, V>
pub fn columns(columns: &[ColumnRef]) -> SQL<'a, V>
Creates a comma-separated list of quoted column names, without table
qualifiers: "id", "name".
Sourcepub fn raw(text: impl Into<Cow<'a, str>>) -> SQL<'a, V>
pub fn raw(text: impl Into<Cow<'a, str>>) -> SQL<'a, V>
Creates a fragment of raw SQL text, written as-is.
The text is not quoted or escaped. Never pass user input here; bind it
with SQL::param instead.
§Examples
use drizzle_core::SQL;
assert_eq!(SQL::<Value>::raw("CURRENT_TIMESTAMP").sql(), "CURRENT_TIMESTAMP");Sourcepub fn number(value: usize) -> SQL<'a, V>
pub fn number(value: usize) -> SQL<'a, V>
Creates an unsigned integer literal, written into the SQL text rather than bound.
Sourcepub fn param(value: impl Into<Cow<'a, V>>) -> SQL<'a, V>
pub fn param(value: impl Into<Cow<'a, V>>) -> SQL<'a, V>
Creates a bound parameter holding value.
The SQL text gets a placeholder (? or $n); the value travels
separately and is returned by SQL::params.
§Examples
use drizzle_core::SQL;
let sql = SQL::param(Value(1)).append(SQL::raw("+")).append(SQL::param(Value(2)));
assert_eq!(sql.sql(), "? + ?");
assert_eq!(sql.params().count(), 2);Sourcepub fn bytes(bytes: impl Into<Cow<'a, [u8]>>) -> SQL<'a, V>
pub fn bytes(bytes: impl Into<Cow<'a, [u8]>>) -> SQL<'a, V>
Creates a bound binary parameter (BLOB / bytea).
Prefer this over SQL::param(Vec<u8>), which some value types treat
as a list rather than one binary value.
Sourcepub fn table(table: TableRef) -> SQL<'a, V>
pub fn table(table: TableRef) -> SQL<'a, V>
Creates a reference to a table, rendered as its quoted name.
Right after SELECT ... FROM, a table reference also lets the
renderer expand an empty projection into the table’s columns.
Sourcepub fn column(column: ColumnRef) -> SQL<'a, V>
pub fn column(column: ColumnRef) -> SQL<'a, V>
Creates a reference to a column, rendered as "table"."column".
Sourcepub fn func(name: &'static str, args: SQL<'a, V>) -> SQL<'a, V>
pub fn func(name: &'static str, args: SQL<'a, V>) -> SQL<'a, V>
Creates a function call: NAME(args).
A subquery argument gets its own parentheses: NAME((SELECT ...)).
§Examples
use drizzle_core::SQL;
let sql = SQL::<Value>::func("LOWER", SQL::ident("email"));
// SQLite and PostgreSQL put a space before `(`; MySQL does not.
assert_eq!(sql.sql(), r#"LOWER ("email")"#);Sourcepub fn append(self, other: impl Into<SQL<'a, V>>) -> SQL<'a, V>
pub fn append(self, other: impl Into<SQL<'a, V>>) -> SQL<'a, V>
Appends another fragment and returns the result.
Sourcepub fn append_mut(&mut self, other: impl Into<SQL<'a, V>>)
pub fn append_mut(&mut self, other: impl Into<SQL<'a, V>>)
Appends another fragment in place.
Sourcepub fn push(self, chunk: impl Into<SQLChunk<'a, V>>) -> SQL<'a, V>
pub fn push(self, chunk: impl Into<SQLChunk<'a, V>>) -> SQL<'a, V>
Appends one chunk (a Token, parameter, …) and returns the result.
Sourcepub fn with_capacity(self, additional: usize) -> SQL<'a, V>
pub fn with_capacity(self, additional: usize) -> SQL<'a, V>
Reserves room for additional more chunks.
Sourcepub fn join<T>(sqls: T, separator: Token) -> SQL<'a, V>
pub fn join<T>(sqls: T, separator: Token) -> SQL<'a, V>
Joins fragments with a separator token. Returns an empty fragment for an empty iterator.
§Examples
use drizzle_core::{SQL, Token};
let cols = [SQL::<Value>::ident("id"), SQL::ident("name")];
assert_eq!(SQL::join(cols, Token::COMMA).sql(), r#""id", "name""#);Sourcepub fn parens_if_subquery(self) -> SQL<'a, V>
pub fn parens_if_subquery(self) -> SQL<'a, V>
Wraps the fragment in parentheses only when it is a subquery (see
SQL::is_subquery).
Sourcepub fn is_subquery(&self) -> bool
pub fn is_subquery(&self) -> bool
Returns true if the fragment starts with a SELECT or WITH token.
Sourcepub fn alias(self, name: impl Into<Cow<'a, str>>) -> SQL<'a, V>
pub fn alias(self, name: impl Into<Cow<'a, str>>) -> SQL<'a, V>
Appends an alias: self AS "name".
Sourcepub fn param_list<I>(values: I) -> SQL<'a, V>
pub fn param_list<I>(values: I) -> SQL<'a, V>
Creates a comma-separated list of bound parameters: ?, ?, ?.
Sourcepub fn assignments<I, T>(pairs: I) -> SQL<'a, V>
pub fn assignments<I, T>(pairs: I) -> SQL<'a, V>
Creates comma-separated assignments with bound values:
"col" = ?, "other" = ?.
Sourcepub fn assignments_sql<I>(pairs: I) -> SQL<'a, V>
pub fn assignments_sql<I>(pairs: I) -> SQL<'a, V>
Creates comma-separated assignments from fragments:
"col" = <expression>.
Unlike SQL::assignments, which binds each value as a parameter,
this keeps each fragment as-is, so placeholders and raw expressions
survive.
Sourcepub fn map_params<U>(self, f: impl FnMut(V) -> U) -> SQL<'a, U>where
U: SQLParam,
pub fn map_params<U>(self, f: impl FnMut(V) -> U) -> SQL<'a, U>where
U: SQLParam,
Converts every bound value with f, changing the value type to U.
Only parameter chunks change. Useful for converting between owned and
borrowed value types (for example OwnedPostgresValue to
PostgresValue<'a>).
Sourcepub fn into_owned_with<U>(self, f: impl FnMut(V) -> U) -> SQL<'static, U>where
U: SQLParam,
pub fn into_owned_with<U>(self, f: impl FnMut(V) -> U) -> SQL<'static, U>where
U: SQLParam,
Copies every borrowed string into owned storage and converts bound
values with f, giving a 'static fragment.
Generated models use this to outlive the values they were built from. Identifiers, raw text, placeholders, tables and columns are all kept.
Sourcepub fn into_owned(self) -> OwnedSQL<V>
pub fn into_owned(self) -> OwnedSQL<V>
Converts into an OwnedSQL with no borrowed data.
Sourcepub fn sql(&self) -> String
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.
Sourcepub fn has_returning(&self) -> bool
pub fn has_returning(&self) -> bool
Whether this statement has a RETURNING clause (outside any
parentheses), so it returns rows although it changes data.
Sourcepub fn inline_sql(&self) -> Option<String>
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).
Sourcepub fn build(&self) -> (String, SmallVec<[&V; 8]>)
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)]);Sourcepub fn build_with(&self, style: ParamStyle) -> (String, SmallVec<[&V; 8]>)
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, ....
Sourcepub fn write_to(&self, buf: &mut impl Write)
pub fn write_to(&self, buf: &mut impl Write)
Writes the SQL text to buf, like SQL::sql without allocating a
new string.
Sourcepub fn write_to_with(&self, buf: &mut impl Write, style: ParamStyle)
pub fn write_to_with(&self, buf: &mut impl Write, style: ParamStyle)
Like write_to, but with a caller-chosen
placeholder style.
Sourcepub fn write_chunk_to(
&self,
buf: &mut impl Write,
chunk: &SQLChunk<'a, V>,
index: usize,
)
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.
Sourcepub fn write_qualified_columns(buf: &mut impl Write, table: &TableSqlRef)
pub fn write_qualified_columns(buf: &mut impl Write, table: &TableSqlRef)
Writes every column of table as "table"."column", separated by
commas, or "table".* when the column list is unknown.
Sourcepub fn params(&self) -> impl Iterator<Item = &V> + use<'_, V>
pub fn params(&self) -> impl Iterator<Item = &V> + use<'_, V>
Returns the bound values, in order. Placeholders without a value are skipped.
Sourcepub fn bind<T>(
self,
params: impl IntoIterator- >>,
) -> SQL<'a, V>
pub fn bind<T>(
self,
params: impl IntoIterator- >>,
) -> SQL<'a, V>
Fills named placeholders with values, matching by name.
Placeholders whose name is not in params keep no value. Values can
come from TypedPlaceholder::bind,
which also checks the value’s SQL type.
§Examples
use drizzle_core::{ParamBind, Placeholder, SQL, ToSQL, Token};
let sql: SQL<'_, Value> = SQL::ident("id")
.push(Token::EQ)
.append(Placeholder::named("id").into_sql());
assert_eq!(sql.params().count(), 0);
let bound = sql.bind([ParamBind::new("id", Value(3))]);
assert_eq!(bound.sql(), r#""id" = :id"#);
assert_eq!(bound.params().collect::<Vec<_>>(), [&Value(3)]);Trait Implementations§
Source§impl<'a, V> Expr<'a, V> for SQL<'a, V>where
V: SQLParam + 'a,
impl<'a, V> Expr<'a, V> for SQL<'a, V>where
V: SQLParam + 'a,
Source§type SQLType = <<V as SQLParam>::DialectMarker as DialectTypes>::Any
type SQLType = <<V as SQLParam>::DialectMarker as DialectTypes>::Any
Source§fn to_expr_sql(&self) -> SQL<'a, V>
fn to_expr_sql(&self) -> SQL<'a, V>
Source§fn into_expr_sql(self) -> SQL<'a, V>where
Self: Sized,
fn into_expr_sql(self) -> SQL<'a, V>where
Self: Sized,
Source§fn to_condition_sql(&self) -> Option<SQL<'a, V>>
fn to_condition_sql(&self) -> Option<SQL<'a, V>>
ConditionList. Read moreSource§fn into_condition_sql(self) -> Option<SQL<'a, V>>where
Self: Sized,
fn into_condition_sql(self) -> Option<SQL<'a, V>>where
Self: Sized,
Expr::to_condition_sql.Source§impl<V> ExprSources for SQL<'_, V>where
V: SQLParam,
impl<V> ExprSources for SQL<'_, V>where
V: SQLParam,
Source§impl<V> ExprValueType for SQL<'_, V>where
V: SQLParam,
Raw SQL has no known type (()); the caller must name the row type.
impl<V> ExprValueType for SQL<'_, V>where
V: SQLParam,
Raw SQL has no known type (()); the caller must name the row type.
Source§impl From<OwnedSQLiteValue> for SQL<'_, OwnedSQLiteValue>
impl From<OwnedSQLiteValue> for SQL<'_, OwnedSQLiteValue>
Source§fn from(value: OwnedSQLiteValue) -> Self
fn from(value: OwnedSQLiteValue) -> Self
Source§impl<'a> From<SQLiteValue<'a>> for SQL<'a, SQLiteValue<'a>>
impl<'a> From<SQLiteValue<'a>> for SQL<'a, SQLiteValue<'a>>
Source§fn from(value: SQLiteValue<'a>) -> Self
fn from(value: SQLiteValue<'a>) -> Self
Source§impl<'a, V, T> FromIterator<T> for SQL<'a, V>
impl<'a, V, T> FromIterator<T> for SQL<'a, V>
Source§impl<'a, V> IntoIterator for SQL<'a, V>where
V: SQLParam,
impl<'a, V> IntoIterator for SQL<'a, V>where
V: SQLParam,
Source§impl<V> IntoSelectTarget for SQL<'_, V>where
V: SQLParam,
select(sql!(...)) → SelectExpr — user must specify row type.
impl<V> IntoSelectTarget for SQL<'_, V>where
V: SQLParam,
select(sql!(...)) → SelectExpr — user must specify row type.
Source§type Marker = SelectExpr
type Marker = SelectExpr
impl<V> OrderTerm for SQL<'_, V>where
V: SQLParam,
Source§impl<V> ScopeEntry for SQL<'_, V>where
V: SQLParam,
impl<V> ScopeEntry for SQL<'_, V>where
V: SQLParam,
impl<V> SelectQuery for SQL<'_, V>where
V: SQLParam,
Auto Trait Implementations§
impl<'a, V> Freeze for SQL<'a, V>
impl<'a, V> RefUnwindSafe for SQL<'a, V>
impl<'a, V> Send for SQL<'a, V>
impl<'a, V> Sync for SQL<'a, V>
impl<'a, V> Unpin for SQL<'a, V>
impl<'a, V> UnsafeUnpin for SQL<'a, V>
impl<'a, V> UnwindSafe for SQL<'a, V>
Blanket Implementations§
Source§impl<T> AliasExt for Twhere
T: ExprValueType,
impl<T> AliasExt for Twhere
T: ExprValueType,
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<'a, V, L, R> ComparisonOperand<'a, V, L> for R
impl<'a, V, L, R> ComparisonOperand<'a, V, L> for R
Source§type Sources = <R as ExprSources>::Sources
type Sources = <R as ExprSources>::Sources
ExprSources::Sources.Source§fn into_comparison_sql(self) -> SQL<'a, V>
fn into_comparison_sql(self) -> SQL<'a, V>
Source§impl<'a, V, E> ExprExt<'a, V> for E
impl<'a, V, E> ExprExt<'a, V> for E
Source§fn eq<R>(
self,
other: R,
) -> SQLExpr<'a, V, <<V as SQLParam>::DialectMarker as DialectTypes>::Bool, NonNull, <Self::Aggregate as AggregateKind>::Or<<R as ComparisonOperand<'a, V, Self>>::Aggregate>, ((Self::Nullable, Self::Sources), (<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>,
fn eq<R>(
self,
other: R,
) -> SQLExpr<'a, V, <<V as SQLParam>::DialectMarker as DialectTypes>::Bool, NonNull, <Self::Aggregate as AggregateKind>::Or<<R as ComparisonOperand<'a, V, Self>>::Aggregate>, ((Self::Nullable, Self::Sources), (<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>,
=); see eq.Source§fn ne<R>(
self,
other: R,
) -> SQLExpr<'a, V, <<V as SQLParam>::DialectMarker as DialectTypes>::Bool, NonNull, <Self::Aggregate as AggregateKind>::Or<<R as ComparisonOperand<'a, V, Self>>::Aggregate>, ((Self::Nullable, Self::Sources), (<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>,
fn ne<R>(
self,
other: R,
) -> SQLExpr<'a, V, <<V as SQLParam>::DialectMarker as DialectTypes>::Bool, NonNull, <Self::Aggregate as AggregateKind>::Or<<R as ComparisonOperand<'a, V, Self>>::Aggregate>, ((Self::Nullable, Self::Sources), (<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>,
<>); see ne.Source§fn gt<R>(
self,
other: R,
) -> SQLExpr<'a, V, <<V as SQLParam>::DialectMarker as DialectTypes>::Bool, NonNull, <Self::Aggregate as AggregateKind>::Or<<R as ComparisonOperand<'a, V, Self>>::Aggregate>, ((Self::Nullable, Self::Sources), (<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>,
fn gt<R>(
self,
other: R,
) -> SQLExpr<'a, V, <<V as SQLParam>::DialectMarker as DialectTypes>::Bool, NonNull, <Self::Aggregate as AggregateKind>::Or<<R as ComparisonOperand<'a, V, Self>>::Aggregate>, ((Self::Nullable, Self::Sources), (<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>,
>); see gt.Source§fn ge<R>(
self,
other: R,
) -> SQLExpr<'a, V, <<V as SQLParam>::DialectMarker as DialectTypes>::Bool, NonNull, <Self::Aggregate as AggregateKind>::Or<<R as ComparisonOperand<'a, V, Self>>::Aggregate>, ((Self::Nullable, Self::Sources), (<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>,
fn ge<R>(
self,
other: R,
) -> SQLExpr<'a, V, <<V as SQLParam>::DialectMarker as DialectTypes>::Bool, NonNull, <Self::Aggregate as AggregateKind>::Or<<R as ComparisonOperand<'a, V, Self>>::Aggregate>, ((Self::Nullable, Self::Sources), (<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>,
>=); see gte.Source§fn lt<R>(
self,
other: R,
) -> SQLExpr<'a, V, <<V as SQLParam>::DialectMarker as DialectTypes>::Bool, NonNull, <Self::Aggregate as AggregateKind>::Or<<R as ComparisonOperand<'a, V, Self>>::Aggregate>, ((Self::Nullable, Self::Sources), (<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>,
fn lt<R>(
self,
other: R,
) -> SQLExpr<'a, V, <<V as SQLParam>::DialectMarker as DialectTypes>::Bool, NonNull, <Self::Aggregate as AggregateKind>::Or<<R as ComparisonOperand<'a, V, Self>>::Aggregate>, ((Self::Nullable, Self::Sources), (<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>,
<); see lt.Source§fn le<R>(
self,
other: R,
) -> SQLExpr<'a, V, <<V as SQLParam>::DialectMarker as DialectTypes>::Bool, NonNull, <Self::Aggregate as AggregateKind>::Or<<R as ComparisonOperand<'a, V, Self>>::Aggregate>, ((Self::Nullable, Self::Sources), (<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>,
fn le<R>(
self,
other: R,
) -> SQLExpr<'a, V, <<V as SQLParam>::DialectMarker as DialectTypes>::Bool, NonNull, <Self::Aggregate as AggregateKind>::Or<<R as ComparisonOperand<'a, V, Self>>::Aggregate>, ((Self::Nullable, Self::Sources), (<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>,
<=); see lte.Source§fn like<R>(
self,
pattern: R,
) -> SQLExpr<'a, V, <<V as SQLParam>::DialectMarker as DialectTypes>::Bool, NonNull, <Self::Aggregate as AggregateKind>::Or<<R as ComparisonOperand<'a, V, Self>>::Aggregate>, ((Self::Nullable, Self::Sources), (<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,
fn like<R>(
self,
pattern: R,
) -> SQLExpr<'a, V, <<V as SQLParam>::DialectMarker as DialectTypes>::Bool, NonNull, <Self::Aggregate as AggregateKind>::Or<<R as ComparisonOperand<'a, V, Self>>::Aggregate>, ((Self::Nullable, Self::Sources), (<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,
LIKE); see like.Source§fn not_like<R>(
self,
pattern: R,
) -> SQLExpr<'a, V, <<V as SQLParam>::DialectMarker as DialectTypes>::Bool, NonNull, <Self::Aggregate as AggregateKind>::Or<<R as ComparisonOperand<'a, V, Self>>::Aggregate>, ((Self::Nullable, Self::Sources), (<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,
fn not_like<R>(
self,
pattern: R,
) -> SQLExpr<'a, V, <<V as SQLParam>::DialectMarker as DialectTypes>::Bool, NonNull, <Self::Aggregate as AggregateKind>::Or<<R as ComparisonOperand<'a, V, Self>>::Aggregate>, ((Self::Nullable, Self::Sources), (<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,
NOT LIKE); see not_like.Source§fn is_null(
self,
) -> SQLExpr<'a, V, <<V as SQLParam>::DialectMarker as DialectTypes>::Bool, NonNull, Self::Aggregate, Coalesce<Self::Sources, NonNull>>
fn is_null( self, ) -> SQLExpr<'a, V, <<V as SQLParam>::DialectMarker as DialectTypes>::Bool, NonNull, Self::Aggregate, Coalesce<Self::Sources, NonNull>>
IS NULL); see is_null.Source§fn is_not_null(
self,
) -> SQLExpr<'a, V, <<V as SQLParam>::DialectMarker as DialectTypes>::Bool, NonNull, Self::Aggregate, Coalesce<Self::Sources, NonNull>>
fn is_not_null( self, ) -> SQLExpr<'a, V, <<V as SQLParam>::DialectMarker as DialectTypes>::Bool, NonNull, Self::Aggregate, Coalesce<Self::Sources, NonNull>>
IS NOT NULL); see is_not_null.Source§fn between<L, H>(
self,
low: L,
high: H,
) -> SQLExpr<'a, V, <<V as SQLParam>::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>, ((Self::Nullable, Self::Sources), ((<L as ComparisonOperand<'a, V, Self>>::Nullable, <L as ComparisonOperand<'a, V, Self>>::Sources), (<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>,
fn between<L, H>(
self,
low: L,
high: H,
) -> SQLExpr<'a, V, <<V as SQLParam>::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>, ((Self::Nullable, Self::Sources), ((<L as ComparisonOperand<'a, V, Self>>::Nullable, <L as ComparisonOperand<'a, V, Self>>::Sources), (<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>,
BETWEEN); see between.Source§fn not_between<L, H>(
self,
low: L,
high: H,
) -> SQLExpr<'a, V, <<V as SQLParam>::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>, ((Self::Nullable, Self::Sources), ((<L as ComparisonOperand<'a, V, Self>>::Nullable, <L as ComparisonOperand<'a, V, Self>>::Sources), (<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>,
fn not_between<L, H>(
self,
low: L,
high: H,
) -> SQLExpr<'a, V, <<V as SQLParam>::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>, ((Self::Nullable, Self::Sources), ((<L as ComparisonOperand<'a, V, Self>>::Nullable, <L as ComparisonOperand<'a, V, Self>>::Sources), (<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>,
NOT BETWEEN); see not_between.Source§fn in_array<I, R>(
self,
values: I,
) -> SQLExpr<'a, V, <<V as SQLParam>::DialectMarker as DialectTypes>::Bool, NonNull, Self::Aggregate, ((Self::Nullable, Self::Sources), (<R as Expr<'a, V>>::Nullable, <R as ExprSources>::Sources))>where
I: IntoIterator<Item = R>,
R: Expr<'a, V>,
Self::SQLType: Compatible<<R as Expr<'a, V>>::SQLType>,
fn in_array<I, R>(
self,
values: I,
) -> SQLExpr<'a, V, <<V as SQLParam>::DialectMarker as DialectTypes>::Bool, NonNull, Self::Aggregate, ((Self::Nullable, Self::Sources), (<R as Expr<'a, V>>::Nullable, <R as ExprSources>::Sources))>where
I: IntoIterator<Item = R>,
R: Expr<'a, V>,
Self::SQLType: Compatible<<R as Expr<'a, V>>::SQLType>,
IN (...)); see in_array.Source§fn not_in_array<I, R>(
self,
values: I,
) -> SQLExpr<'a, V, <<V as SQLParam>::DialectMarker as DialectTypes>::Bool, NonNull, Self::Aggregate, ((Self::Nullable, Self::Sources), (<R as Expr<'a, V>>::Nullable, <R as ExprSources>::Sources))>where
I: IntoIterator<Item = R>,
R: Expr<'a, V>,
Self::SQLType: Compatible<<R as Expr<'a, V>>::SQLType>,
fn not_in_array<I, R>(
self,
values: I,
) -> SQLExpr<'a, V, <<V as SQLParam>::DialectMarker as DialectTypes>::Bool, NonNull, Self::Aggregate, ((Self::Nullable, Self::Sources), (<R as Expr<'a, V>>::Nullable, <R as ExprSources>::Sources))>where
I: IntoIterator<Item = R>,
R: Expr<'a, V>,
Self::SQLType: Compatible<<R as Expr<'a, V>>::SQLType>,
NOT IN (...)); see
not_in_array.Source§fn in_subquery<S>(
self,
subquery: S,
) -> SQLExpr<'a, V, <<V as SQLParam>::DialectMarker as DialectTypes>::Bool, NonNull, Self::Aggregate, ((Self::Nullable, Self::Sources), (<S as Expr<'a, V>>::Nullable, <S as ExprSources>::Sources))>
fn in_subquery<S>( self, subquery: S, ) -> SQLExpr<'a, V, <<V as SQLParam>::DialectMarker as DialectTypes>::Bool, NonNull, Self::Aggregate, ((Self::Nullable, Self::Sources), (<S as Expr<'a, V>>::Nullable, <S as ExprSources>::Sources))>
IN (SELECT ...)); see
in_subquery.Source§fn not_in_subquery<S>(
self,
subquery: S,
) -> SQLExpr<'a, V, <<V as SQLParam>::DialectMarker as DialectTypes>::Bool, NonNull, Self::Aggregate, ((Self::Nullable, Self::Sources), (<S as Expr<'a, V>>::Nullable, <S as ExprSources>::Sources))>
fn not_in_subquery<S>( self, subquery: S, ) -> SQLExpr<'a, V, <<V as SQLParam>::DialectMarker as DialectTypes>::Bool, NonNull, Self::Aggregate, ((Self::Nullable, Self::Sources), (<S as Expr<'a, V>>::Nullable, <S as ExprSources>::Sources))>
NOT IN (SELECT ...)); see
not_in_subquery.Source§fn is_distinct_from<R>(
self,
other: R,
) -> SQLExpr<'a, V, <<V as SQLParam>::DialectMarker as DialectTypes>::Bool, NonNull, <Self::Aggregate as AggregateKind>::Or<<R as ComparisonOperand<'a, V, Self>>::Aggregate>, Coalesce<(Self::Sources, <R as ComparisonOperand<'a, V, Self>>::Sources), NonNull>>where
R: ComparisonOperand<'a, V, Self>,
Self::SQLType: Compatible<<R as ComparisonOperand<'a, V, Self>>::SQLType>,
fn is_distinct_from<R>(
self,
other: R,
) -> SQLExpr<'a, V, <<V as SQLParam>::DialectMarker as DialectTypes>::Bool, NonNull, <Self::Aggregate as AggregateKind>::Or<<R as ComparisonOperand<'a, V, Self>>::Aggregate>, Coalesce<(Self::Sources, <R as ComparisonOperand<'a, V, Self>>::Sources), NonNull>>where
R: ComparisonOperand<'a, V, Self>,
Self::SQLType: Compatible<<R as ComparisonOperand<'a, V, Self>>::SQLType>,
IS DISTINCT FROM); see is_distinct_from.Source§fn is_not_distinct_from<R>(
self,
other: R,
) -> SQLExpr<'a, V, <<V as SQLParam>::DialectMarker as DialectTypes>::Bool, NonNull, <Self::Aggregate as AggregateKind>::Or<<R as ComparisonOperand<'a, V, Self>>::Aggregate>, Coalesce<(Self::Sources, <R as ComparisonOperand<'a, V, Self>>::Sources), NonNull>>where
R: ComparisonOperand<'a, V, Self>,
Self::SQLType: Compatible<<R as ComparisonOperand<'a, V, Self>>::SQLType>,
fn is_not_distinct_from<R>(
self,
other: R,
) -> SQLExpr<'a, V, <<V as SQLParam>::DialectMarker as DialectTypes>::Bool, NonNull, <Self::Aggregate as AggregateKind>::Or<<R as ComparisonOperand<'a, V, Self>>::Aggregate>, Coalesce<(Self::Sources, <R as ComparisonOperand<'a, V, Self>>::Sources), NonNull>>where
R: ComparisonOperand<'a, V, Self>,
Self::SQLType: Compatible<<R as ComparisonOperand<'a, V, Self>>::SQLType>,
IS NOT DISTINCT FROM); see is_not_distinct_from.Source§impl<Joined, From> JoinKey<From, JoinReverse> for Joined
impl<Joined, From> JoinKey<From, JoinReverse> for Joined
impl<List> ListIncludes<Nil, ()> for List
impl<Mk> MarkerAggValidFor<()> for Mk
Source§impl<T> ToCompactString for Twhere
T: Display,
impl<T> ToCompactString for Twhere
T: Display,
Source§fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
ToCompactString::to_compact_string() Read moreSource§fn to_compact_string(&self) -> CompactString
fn to_compact_string(&self) -> CompactString
CompactString. Read more