pub struct QueryBuilder<D: Dialect> { /* private fields */ }Expand description
Typed, dialect-aware SQL query builder.
Implementations§
Source§impl<D: Dialect> QueryBuilder<D>
impl<D: Dialect> QueryBuilder<D>
Sourcepub fn db(self, name: &str) -> Self
pub fn db(self, name: &str) -> Self
Set the database/schema qualifier (multi-tenant: one connection, many DBs).
The name prefixes the main table and every join table, escaped per dialect:
QueryBuilder::<Postgres>::table("users").db("mydb") →
… FROM "mydb"."users". Matches 1.x db().
Sourcepub fn select<I, S>(self, cols: I) -> Self
pub fn select<I, S>(self, cols: I) -> Self
Restrict the selected columns. An empty list selects *.
Sourcepub fn select_raw(self, sql: &str, binds: Option<Vec<Value>>) -> Self
pub fn select_raw(self, sql: &str, binds: Option<Vec<Value>>) -> Self
Add a raw SELECT expression (verbatim, NOT escaped) with optional binds
— the escape hatch for aggregates/functions like COUNT(*).
Appended to the column list after any Self::select columns. Multiple
calls accumulate.
§Warning: positional placeholder contract
sql is emitted verbatim (it is NOT escaped or renumbered) and any
binds are appended to the running bind list in order. For Postgres,
the caller MUST write $N numbers matching the actual bind position. For
MySQL/SQLite use ?.
Sourcepub fn select_subquery(self, alias: &str, sub: QueryBuilder<D>) -> Self
pub fn select_subquery(self, alias: &str, sub: QueryBuilder<D>) -> Self
Add a subquery SELECT column: emits (<sub>) AS {alias} after the
regular columns and any Self::select_raw expressions.
The subquery is compiled with placeholder continuity (its binds appear in
$N order at the point it is emitted — before the WHERE clause, since
the SELECT list is rendered first). SELECT-only.
Sourcepub fn select_count(self, col: &str) -> Self
pub fn select_count(self, col: &str) -> Self
Add COUNT(col) to the SELECT list (col == "*" → COUNT(*)).
Sourcepub fn select_count_as(self, col: &str, alias: &str) -> Self
pub fn select_count_as(self, col: &str, alias: &str) -> Self
Add COUNT(col) AS alias (both identifiers escaped; * passed through).
Sourcepub fn select_sum(self, col: &str) -> Self
pub fn select_sum(self, col: &str) -> Self
Add SUM(col) to the SELECT list.
Sourcepub fn select_sum_as(self, col: &str, alias: &str) -> Self
pub fn select_sum_as(self, col: &str, alias: &str) -> Self
Add SUM(col) AS alias.
Sourcepub fn select_avg(self, col: &str) -> Self
pub fn select_avg(self, col: &str) -> Self
Add AVG(col) to the SELECT list.
Sourcepub fn select_avg_as(self, col: &str, alias: &str) -> Self
pub fn select_avg_as(self, col: &str, alias: &str) -> Self
Add AVG(col) AS alias.
Sourcepub fn select_min(self, col: &str) -> Self
pub fn select_min(self, col: &str) -> Self
Add MIN(col) to the SELECT list.
Sourcepub fn select_min_as(self, col: &str, alias: &str) -> Self
pub fn select_min_as(self, col: &str, alias: &str) -> Self
Add MIN(col) AS alias.
Sourcepub fn select_max(self, col: &str) -> Self
pub fn select_max(self, col: &str) -> Self
Add MAX(col) to the SELECT list.
Sourcepub fn select_max_as(self, col: &str, alias: &str) -> Self
pub fn select_max_as(self, col: &str, alias: &str) -> Self
Add MAX(col) AS alias.
Sourcepub fn select_as(self, col: &str, alias: &str) -> Self
pub fn select_as(self, col: &str, alias: &str) -> Self
Add col AS alias to the SELECT list (both identifiers escaped).
Sourcepub fn distinct_on<I, S>(self, cols: I) -> Self
pub fn distinct_on<I, S>(self, cols: I) -> Self
Emit SELECT DISTINCT ON (cols) … — Postgres only.
cols are raw identifiers (escaped at compile time). Compiling against a
dialect without DISTINCT ON support panics
(DISTINCT ON requires PostgreSQL).
Sourcepub fn where_ilike(self, col: &str, val: impl IntoBind) -> Self
pub fn where_ilike(self, col: &str, val: impl IntoBind) -> Self
col ILIKE val — dialect-aware case-insensitive match.
On Postgres this compiles to the native {col} ILIKE {ph}. On
MySQL/SQLite (no native ILIKE) it compiles to
LOWER({col}) LIKE LOWER({ph}).
Sourcepub fn where_jsonb_contains(self, col: &str, val: impl IntoBind) -> Self
pub fn where_jsonb_contains(self, col: &str, val: impl IntoBind) -> Self
col @> val — JSONB containment.
Postgres-specific: the @> operator is emitted verbatim for all
dialects, but is only meaningful on Postgres jsonb columns. val is
typically a JSON text string (or Value::Json behind the json
feature).
Sourcepub fn where_like(self, col: &str, val: impl IntoBind) -> Self
pub fn where_like(self, col: &str, val: impl IntoBind) -> Self
col LIKE val.
Sourcepub fn where_in(
self,
col: &str,
vals: impl IntoIterator<Item = impl IntoBind>,
) -> Self
pub fn where_in( self, col: &str, vals: impl IntoIterator<Item = impl IntoBind>, ) -> Self
col IN (...).
Sourcepub fn where_not_in(
self,
col: &str,
vals: impl IntoIterator<Item = impl IntoBind>,
) -> Self
pub fn where_not_in( self, col: &str, vals: impl IntoIterator<Item = impl IntoBind>, ) -> Self
col NOT IN (...).
Sourcepub fn where_null(self, col: &str) -> Self
pub fn where_null(self, col: &str) -> Self
col IS NULL.
Sourcepub fn where_not_null(self, col: &str) -> Self
pub fn where_not_null(self, col: &str) -> Self
col IS NOT NULL.
Sourcepub fn where_between(
self,
col: &str,
lo: impl IntoBind,
hi: impl IntoBind,
) -> Self
pub fn where_between( self, col: &str, lo: impl IntoBind, hi: impl IntoBind, ) -> Self
col BETWEEN lo AND hi.
Sourcepub fn where_raw(self, sql: &str, binds: Vec<Value>) -> Self
pub fn where_raw(self, sql: &str, binds: Vec<Value>) -> Self
Raw SQL predicate with its own binds — the verbatim escape hatch.
§Warning: positional placeholder contract
sql is emitted verbatim (it is NOT escaped or renumbered) and
binds are appended to the running bind list in order. For
Postgres, the caller MUST write $N numbers matching the actual
bind position — that is, number of binds already accumulated + 1, +2,
… For MySQL/SQLite use ?. No renumbering is performed, so a wrong $N
produces a malformed query.
Sourcepub fn where_column(self, lhs: &str, op: &'static str, rhs: &str) -> Self
pub fn where_column(self, lhs: &str, op: &'static str, rhs: &str) -> Self
lhs op rhs — compare two column identifiers (both escaped at compile
time), no bind. e.g. where_column("orders.user_id", "=", "users.id").
Sourcepub fn where_exists(self, sub: QueryBuilder<D>) -> Self
pub fn where_exists(self, sub: QueryBuilder<D>) -> Self
EXISTS (subquery) — takes an already-built sub-builder by value
(mirrors Self::union / Self::with). The sub-query is compiled
with placeholder continuity.
Sourcepub fn where_not_exists(self, sub: QueryBuilder<D>) -> Self
pub fn where_not_exists(self, sub: QueryBuilder<D>) -> Self
NOT EXISTS (subquery). See Self::where_exists.
Sourcepub fn where_in_subquery(self, col: &str, sub: QueryBuilder<D>) -> Self
pub fn where_in_subquery(self, col: &str, sub: QueryBuilder<D>) -> Self
col IN (subquery) — takes an already-built sub-builder by value. The
sub-query is compiled with placeholder continuity.
Sourcepub fn where_not_in_subquery(self, col: &str, sub: QueryBuilder<D>) -> Self
pub fn where_not_in_subquery(self, col: &str, sub: QueryBuilder<D>) -> Self
col NOT IN (subquery). See Self::where_in_subquery.
Sourcepub fn and_where(
self,
f: impl FnOnce(WhereBuilder<D>) -> WhereBuilder<D>,
) -> Self
pub fn and_where( self, f: impl FnOnce(WhereBuilder<D>) -> WhereBuilder<D>, ) -> Self
Add a parenthesized AND (...) group built by the closure.
Sourcepub fn or_where(
self,
f: impl FnOnce(WhereBuilder<D>) -> WhereBuilder<D>,
) -> Self
pub fn or_where( self, f: impl FnOnce(WhereBuilder<D>) -> WhereBuilder<D>, ) -> Self
Add a parenthesized OR (...) group built by the closure.
Sourcepub fn insert<K, V, I>(self, row: I) -> Self
pub fn insert<K, V, I>(self, row: I) -> Self
Build an INSERT from a single row of (column, value) pairs.
Sourcepub fn insert_many<K, V, R, Rows>(self, rows: Rows) -> Self
pub fn insert_many<K, V, R, Rows>(self, rows: Rows) -> Self
Build a multi-row INSERT from an iterator of rows, each a sequence of
(column, value) pairs.
The inserted column set is taken from the first row’s keys (sorted, as
with Self::insert). For each subsequent row, a value is bound for every
column in that set; a key missing in a later row binds Value::Null
rather than panicking (DoS-safe, matching the 1.x hardening). Composes with
on_conflict_* and returning.
Sourcepub fn update<K, V, I>(self, set: I) -> Self
pub fn update<K, V, I>(self, set: I) -> Self
Build an UPDATE from (column, value) pairs. WHERE still applies.
Sourcepub fn on_conflict_do_nothing<I, S>(self, targets: I) -> Self
pub fn on_conflict_do_nothing<I, S>(self, targets: I) -> Self
On conflict, skip the row (INSERT-only; ignored on UPDATE/DELETE).
targets are the conflict-target columns (may be empty).
- Postgres / SQLite: emits
ON CONFLICT ({targets}) DO NOTHING, or bareON CONFLICT DO NOTHINGwhentargetsis empty. - MySQL: emits
INSERT IGNORE INTO …(no trailing clause). Note thatIGNOREsuppresses more than duplicate-key errors (also truncation and bad-value coercion) — broader than pg/sqliteDO NOTHING.
Sourcepub fn on_conflict_merge<I, S>(self, targets: I) -> Self
pub fn on_conflict_merge<I, S>(self, targets: I) -> Self
On conflict, update the non-target inserted columns from the proposed row
(INSERT-only; ignored on UPDATE/DELETE).
- Postgres / SQLite: emits
ON CONFLICT ({targets}) DO UPDATE SET {c} = EXCLUDED.{c}, …for every inserted column except the conflict targets. Iftargetsis empty or covers all inserted columns (empty SET list), falls back to theDO NOTHINGrendering (pg/sqlite require a target forDO UPDATE). - MySQL: the explicit
targetsare ignored (MySQL uses its own unique/primary keys); emitsON DUPLICATE KEY UPDATE {c} = VALUES({c}), …for all inserted columns.VALUES()is used for MySQL 5.7/8.x compatibility. Including a PK column in the insert set yields a redundant-but-harmlesspk = VALUES(pk).
Sourcepub fn returning<I, S>(self, cols: I) -> Self
pub fn returning<I, S>(self, cols: I) -> Self
Add a RETURNING column list. Works on INSERT / UPDATE / DELETE for
Postgres and SQLite; a "*" column is emitted unescaped (RETURNING *).
On MySQL this is a silent no-op (MySQL has no RETURNING). On
SQLite RETURNING requires SQLite ≥ 3.35.0 (2021); supports_returning()
is a compile-time dialect flag, not a runtime version check.
Sourcepub fn group_by<I, S>(self, cols: I) -> Self
pub fn group_by<I, S>(self, cols: I) -> Self
Add GROUP BY columns (raw owned identifiers, escaped at compile time).
SELECT-only: ignored for INSERT/UPDATE/DELETE.
Sourcepub fn group_by_raw(self, sql: &str, binds: Vec<Value>) -> Self
pub fn group_by_raw(self, sql: &str, binds: Vec<Value>) -> Self
Add a raw GROUP BY fragment with its own binds — the verbatim escape
hatch. SELECT-only.
The fragment is appended after any structured Self::group_by columns
within the same GROUP BY clause (e.g. GROUP BY "a", <raw>); if no
structured columns are present it becomes the whole GROUP BY <raw>.
§Warning: positional placeholder contract
sql is emitted verbatim (it is NOT escaped or renumbered) and
binds are appended to the running bind list in order. For
Postgres, the caller MUST write $N numbers matching the actual
bind position — that is, number of binds already accumulated + 1, +2,
… For MySQL/SQLite use ?. No renumbering is performed, so a wrong $N
produces a malformed query.
Sourcepub fn order_by_raw(self, sql: &str, binds: Vec<Value>) -> Self
pub fn order_by_raw(self, sql: &str, binds: Vec<Value>) -> Self
Add a raw ORDER BY fragment with its own binds — the verbatim escape
hatch. SELECT-only.
The fragment is appended after any structured Self::order_by terms
within the same ORDER BY clause (e.g. ORDER BY "a" ASC, <raw>); if no
structured terms are present it becomes the whole ORDER BY <raw>.
§Warning: positional placeholder contract
sql is emitted verbatim (it is NOT escaped or renumbered) and
binds are appended to the running bind list in order. For
Postgres, the caller MUST write $N numbers matching the actual
bind position — that is, number of binds already accumulated + 1, +2,
… For MySQL/SQLite use ?. No renumbering is performed, so a wrong $N
produces a malformed query.
Sourcepub fn order_by(self, col: &str, ord: Order) -> Self
pub fn order_by(self, col: &str, ord: Order) -> Self
Add an ORDER BY col <ord> term. SELECT-only.
Sourcepub fn order_by_asc(self, col: &str) -> Self
pub fn order_by_asc(self, col: &str) -> Self
Add an ORDER BY col ASC term. SELECT-only.
Sourcepub fn order_by_desc(self, col: &str) -> Self
pub fn order_by_desc(self, col: &str) -> Self
Add an ORDER BY col DESC term. SELECT-only.
Sourcepub fn offset(self, n: i64) -> Self
pub fn offset(self, n: i64) -> Self
Set OFFSET n (bound as a placeholder). SELECT-only.
offset requires limit: compiling an offset without a limit panics
(offset(...) requires limit(...)), uniform across dialects since MySQL
rejects a bare OFFSET.
Sourcepub fn for_update(self) -> Self
pub fn for_update(self) -> Self
Lock selected rows with FOR UPDATE. SELECT-only.
Honored by Postgres / MySQL; a silent no-op on SQLite. Preserves any
SKIP LOCKED / NOWAIT modifier already set.
Lock selected rows with FOR SHARE. SELECT-only.
Honored by Postgres / MySQL; a silent no-op on SQLite. Preserves any
SKIP LOCKED / NOWAIT modifier already set.
Sourcepub fn skip_locked(self) -> Self
pub fn skip_locked(self) -> Self
Add SKIP LOCKED to the row-locking clause (skip already-locked rows).
If no lock strength was set yet, defaults to FOR UPDATE. SELECT-only;
no-op on SQLite.
Sourcepub fn no_wait(self) -> Self
pub fn no_wait(self) -> Self
Add NOWAIT to the row-locking clause (error if a row is already locked).
If no lock strength was set yet, defaults to FOR UPDATE. SELECT-only;
no-op on SQLite.
Sourcepub fn join(
self,
table: &str,
f: impl FnOnce(JoinClause<D>) -> JoinClause<D>,
) -> Self
pub fn join( self, table: &str, f: impl FnOnce(JoinClause<D>) -> JoinClause<D>, ) -> Self
INNER JOIN table ON … — conditions built by the closure.
SELECT-only: ignored for INSERT/UPDATE/DELETE.
Sourcepub fn left_join(
self,
table: &str,
f: impl FnOnce(JoinClause<D>) -> JoinClause<D>,
) -> Self
pub fn left_join( self, table: &str, f: impl FnOnce(JoinClause<D>) -> JoinClause<D>, ) -> Self
LEFT JOIN table ON …. SELECT-only.
Sourcepub fn right_join(
self,
table: &str,
f: impl FnOnce(JoinClause<D>) -> JoinClause<D>,
) -> Self
pub fn right_join( self, table: &str, f: impl FnOnce(JoinClause<D>) -> JoinClause<D>, ) -> Self
RIGHT JOIN table ON …. SELECT-only.
Sourcepub fn full_outer_join(
self,
table: &str,
f: impl FnOnce(JoinClause<D>) -> JoinClause<D>,
) -> Self
pub fn full_outer_join( self, table: &str, f: impl FnOnce(JoinClause<D>) -> JoinClause<D>, ) -> Self
FULL OUTER JOIN table ON …. SELECT-only.
Sourcepub fn cross_join(self, table: &str) -> Self
pub fn cross_join(self, table: &str) -> Self
CROSS JOIN table — takes no ON closure (a cross join has no
condition). SELECT-only.
Sourcepub fn having(self, col: &str, op: &str, val: impl IntoBind) -> Self
pub fn having(self, col: &str, op: &str, val: impl IntoBind) -> Self
HAVING col op ? — col is a real column/alias (escaped); value bound.
For aggregate expressions like COUNT(*) > ?, use Self::having_raw.
SELECT-only: ignored for INSERT/UPDATE/DELETE. Multiple HAVING terms are
joined by AND.
Sourcepub fn having_raw(self, sql: &str, binds: Vec<Value>) -> Self
pub fn having_raw(self, sql: &str, binds: Vec<Value>) -> Self
Raw HAVING expression with its own binds — the verbatim escape hatch
for aggregates (e.g. having_raw("COUNT(*) > ?", …)).
§Warning: positional placeholder contract
sql is emitted verbatim (it is NOT escaped or renumbered) and
binds are appended to the running bind list in order. For
Postgres, the caller MUST write $N numbers matching the actual
bind position — that is, number of binds already accumulated + 1, +2,
… For MySQL/SQLite use ?. No renumbering is performed, so a wrong $N
produces a malformed query.
Sourcepub fn with(self, name: &str, query: QueryBuilder<D>) -> Self
pub fn with(self, name: &str, query: QueryBuilder<D>) -> Self
Add a WITH name AS (query) common table expression. SELECT-only.
CTE bodies are compiled before the main query, so their binds (and pg
$N numbers) appear first.
Sourcepub fn with_recursive(self, name: &str, query: QueryBuilder<D>) -> Self
pub fn with_recursive(self, name: &str, query: QueryBuilder<D>) -> Self
Add a recursive CTE. If any CTE is recursive, the single WITH carries
RECURSIVE. SELECT-only.
Sourcepub fn union(self, query: QueryBuilder<D>) -> Self
pub fn union(self, query: QueryBuilder<D>) -> Self
Append a UNION query arm. SELECT-only.
Sourcepub fn union_all(self, query: QueryBuilder<D>) -> Self
pub fn union_all(self, query: QueryBuilder<D>) -> Self
Append a UNION ALL query arm. SELECT-only.
Sourcepub fn when(self, cond: bool, f: impl FnOnce(Self) -> Self) -> Self
pub fn when(self, cond: bool, f: impl FnOnce(Self) -> Self) -> Self
Conditionally apply f to the builder, keeping the chain intact.
Returns f(self) when cond is true, otherwise self unchanged. This
lets you add clauses based on a runtime flag without breaking the
by-value chain.
use chain_builder::v2::{Postgres, QueryBuilder};
let only_active = true;
let (sql, _) = QueryBuilder::<Postgres>::table("users")
.select(["id"])
.when(only_active, |q| q.where_eq("status", "active"))
.to_sql();
assert_eq!(sql, r#"SELECT "id" FROM "users" WHERE "status" = $1"#);Sourcepub fn when_else(
self,
cond: bool,
if_true: impl FnOnce(Self) -> Self,
if_false: impl FnOnce(Self) -> Self,
) -> Self
pub fn when_else( self, cond: bool, if_true: impl FnOnce(Self) -> Self, if_false: impl FnOnce(Self) -> Self, ) -> Self
Apply if_true when cond holds, otherwise if_false, keeping the
chain intact.
use chain_builder::v2::{Postgres, QueryBuilder};
let active = false;
let (sql, _) = QueryBuilder::<Postgres>::table("users")
.select(["id"])
.when_else(
active,
|q| q.where_eq("status", "active"),
|q| q.where_eq("status", "inactive"),
)
.to_sql();
assert_eq!(sql, r#"SELECT "id" FROM "users" WHERE "status" = $1"#);Sourcepub fn paginate(self, page: i64, per_page: i64) -> Self
pub fn paginate(self, page: i64, per_page: i64) -> Self
Apply LIMIT/OFFSET for a 1-based page: row window
[(page-1) * per_page, page * per_page).
Equivalent to self.limit(per_page).offset((page - 1).max(0) * per_page).
A page < 1 is treated as page 1 (offset 0), so callers never get a
negative offset. SELECT-only, like Self::limit / Self::offset.
use chain_builder::v2::{Postgres, QueryBuilder, Value};
let (sql, binds) = QueryBuilder::<Postgres>::table("users")
.select(["id"])
.paginate(2, 10)
.to_sql();
assert_eq!(sql, r#"SELECT "id" FROM "users" LIMIT $1 OFFSET $2"#);
assert_eq!(binds, vec![Value::I64(10), Value::I64(10)]);Source§impl<D: SqlxDialect> QueryBuilder<D>
impl<D: SqlxDialect> QueryBuilder<D>
Sourcepub async fn fetch_all<'e, T, E>(&self, executor: E) -> Result<Vec<T>, Error>
pub async fn fetch_all<'e, T, E>(&self, executor: E) -> Result<Vec<T>, Error>
Fetch all rows, decoding each into T.
Delegates to self.to_sqlx_query_as::<T>().fetch_all(executor).
Sourcepub async fn fetch_one<'e, T, E>(&self, executor: E) -> Result<T, Error>
pub async fn fetch_one<'e, T, E>(&self, executor: E) -> Result<T, Error>
Fetch exactly one row, decoding it into T.
Errors with sqlx::Error::RowNotFound if no row is returned.
Sourcepub async fn fetch_optional<'e, T, E>(
&self,
executor: E,
) -> Result<Option<T>, Error>
pub async fn fetch_optional<'e, T, E>( &self, executor: E, ) -> Result<Option<T>, Error>
Fetch at most one row, decoding it into T.
Sourcepub async fn execute<'e, E>(
&self,
executor: E,
) -> Result<<D::Database as Database>::QueryResult, Error>
pub async fn execute<'e, E>( &self, executor: E, ) -> Result<<D::Database as Database>::QueryResult, Error>
Execute the query (INSERT / UPDATE / DELETE / DDL), returning the
database’s QueryResult (affected rows, last insert id, …).
Delegates to self.to_sqlx_query().execute(executor).
Sourcepub async fn count<'e, E>(&self, executor: E) -> Result<i64, Error>
pub async fn count<'e, E>(&self, executor: E) -> Result<i64, Error>
Count the rows the query would return.
Wraps the built SQL as SELECT COUNT(*) FROM (<sql>) AS __cb_count, binds
the same arguments, and fetches a single i64. Mirrors 1.x
ChainBuilder::count.
Sourcepub async fn fetch_scalar<'e, T, E>(&self, executor: E) -> Result<T, Error>
pub async fn fetch_scalar<'e, T, E>(&self, executor: E) -> Result<T, Error>
Fetch the first column of the first row, decoded into T.
Errors with sqlx::Error::RowNotFound if no row is returned. Useful for
pluck/aggregate-style queries.
Sourcepub async fn fetch_optional_scalar<'e, T, E>(
&self,
executor: E,
) -> Result<Option<T>, Error>
pub async fn fetch_optional_scalar<'e, T, E>( &self, executor: E, ) -> Result<Option<T>, Error>
Fetch the first column of the first row (if any), decoded into T.
Source§impl<D: SqlxDialect> QueryBuilder<D>
impl<D: SqlxDialect> QueryBuilder<D>
Sourcepub fn to_sqlx_query(
&self,
) -> Query<'_, D::Database, <D::Database as Database>::Arguments>
pub fn to_sqlx_query( &self, ) -> Query<'_, D::Database, <D::Database as Database>::Arguments>
Build an executable sqlx::query::Query from this builder.
The SQL is builder-generated with bound placeholders, so it is asserted
safe via sqlx::AssertSqlSafe (which also satisfies sqlx 0.9’s 'static
SQL bound). Mirrors 1.x ChainBuilder::to_sqlx_query.
Trait Implementations§
Source§impl<D: Clone + Dialect> Clone for QueryBuilder<D>
impl<D: Clone + Dialect> Clone for QueryBuilder<D>
Source§fn clone(&self) -> QueryBuilder<D>
fn clone(&self) -> QueryBuilder<D>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl<D: PartialEq + Dialect> PartialEq for QueryBuilder<D>
impl<D: PartialEq + Dialect> PartialEq for QueryBuilder<D>
Source§fn eq(&self, other: &QueryBuilder<D>) -> bool
fn eq(&self, other: &QueryBuilder<D>) -> bool
self and other values to be equal, and is used by ==.impl<D: Dialect> StructuralPartialEq for QueryBuilder<D>
Auto Trait Implementations§
impl<D> Freeze for QueryBuilder<D>
impl<D> RefUnwindSafe for QueryBuilder<D>where
D: RefUnwindSafe,
impl<D> Send for QueryBuilder<D>
impl<D> Sync for QueryBuilder<D>
impl<D> Unpin for QueryBuilder<D>where
D: Unpin,
impl<D> UnsafeUnpin for QueryBuilder<D>
impl<D> UnwindSafe for QueryBuilder<D>where
D: UnwindSafe,
Blanket Implementations§
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<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more