diesel

Module query_builder

Source
Expand description

Contains traits responsible for the actual construction of SQL statements

The types in this module are part of Diesel’s public API, but are generally only useful for implementing Diesel plugins. Applications should generally not need to care about the types inside of this module.

Re-exports§

  • pub use crate::pg::query_builder::tablesample::TablesampleMethod;
    postgres_backend

Modules§

  • Types related to managing bind parameters during query construction.

Structs§

  • Alli-implement-a-third-party-backend-and-opt-into-breaking-changes
    Keep duplicate rows in the result
  • The primary type used when walking a Diesel AST during query execution.
  • AstPassToSqlOptionsi-implement-a-third-party-backend-and-opt-into-breaking-changes
    This is used to pass down additional settings to the AstPass when rendering the sql string.
  • BatchInserti-implement-a-third-party-backend-and-opt-into-breaking-changes
    This type represents a batch insert clause, which allows to insert multiple rows at once.
  • BoxedLimitOffsetClausei-implement-a-third-party-backend-and-opt-into-breaking-changes
    A boxed variant of LimitOffsetClause
  • BoxedSelectStatementi-implement-a-third-party-backend-and-opt-into-breaking-changes
    This type represents a boxed select query
  • CollectedQueryi-implement-a-third-party-backend-and-opt-into-breaking-changes
    A SQL query variant with already collected bind data which can be moved
  • A struct that implements fmt::Display and fmt::Debug to show the SQL representation of a query.
  • DefaultValuesi-implement-a-third-party-backend-and-opt-into-breaking-changes
  • Represents a SQL DELETE statement.
  • Distincti-implement-a-third-party-backend-and-opt-into-breaking-changes
    Remove duplicate rows in the result, this is the default behavior of UNION, INTERSECT and EXCEPT
  • Excepti-implement-a-third-party-backend-and-opt-into-breaking-changes
    Computes the set difference of the rows returned by the involved SELECT statements using SQL EXCEPT
  • FromClausei-implement-a-third-party-backend-and-opt-into-breaking-changes
  • The structure returned by insert_into.
  • InsertOrIgnorei-implement-a-third-party-backend-and-opt-into-breaking-changes
  • InsertStatementi-implement-a-third-party-backend-and-opt-into-breaking-changes
    A fully constructed insert statement.
  • Intersecti-implement-a-third-party-backend-and-opt-into-breaking-changes
    Computes the set intersection of the rows returned by the involved SELECT statements using SQL INTERSECT
  • LimitClausei-implement-a-third-party-backend-and-opt-into-breaking-changes
    A query node representing a limit clause
  • LimitOffsetClausei-implement-a-third-party-backend-and-opt-into-breaking-changes
    A helper query node that contains both limit and offset clauses
  • NoFromClausei-implement-a-third-party-backend-and-opt-into-breaking-changes
    This type represents a not existing from clause
  • NoLimitClausei-implement-a-third-party-backend-and-opt-into-breaking-changes
    A query node indicating the absence of a limit clause
  • NoOffsetClausei-implement-a-third-party-backend-and-opt-into-breaking-changes
    A query node indicating the absence of an offset clause
  • OffsetClausei-implement-a-third-party-backend-and-opt-into-breaking-changes
    A query node representing an offset clause
  • Onlypostgres_backend
    Represents a query with an ONLY clause.
  • ParenthesisWrapperi-implement-a-third-party-backend-and-opt-into-breaking-changes
    Wrapper used to wrap rhs sql in parenthesis when supported by backend
  • Replacei-implement-a-third-party-backend-and-opt-into-breaking-changes
  • ReturningClausei-implement-a-third-party-backend-and-opt-into-breaking-changes
    This type represents a SQL Returning clause
  • SelectStatementi-implement-a-third-party-backend-and-opt-into-breaking-changes
    This type represents a select query
  • The return value of sql_query.
  • Tablesamplepostgres_backend
    Represents a query with a TABLESAMPLE clause.
  • Unioni-implement-a-third-party-backend-and-opt-into-breaking-changes
    Computes the set union of the rows returned by the involved SELECT statements using SQL UNION
  • Represents a complete UPDATE statement.
  • ValuesClausei-implement-a-third-party-backend-and-opt-into-breaking-changes
    This type represents a values clause used as part of insert statements

Traits§

  • Types which can be passed to update.set.
  • Types that can be converted into a complete, typed SQL query.
  • A type which manages serializing bind parameters during query construction.
  • Interface to add information to conflict targets. Designed to be open for further additions to conflict targets like constraints
  • A trait used to construct type erased boxed variant of the current query node
  • A type which can be passed to update or delete.
  • MoveableBindCollectori-implement-a-third-party-backend-and-opt-into-breaking-changes
    A movable version of the bind collector which allows it to be extracted, moved and refilled.
  • A complete SQL query with a return type.
  • Constructs a SQL query from a Diesel AST.
  • An untyped fragment of SQL.
  • Uniquely identifies queries by their type for the purpose of prepared statement caching.
  • SelectClauseExpressioni-implement-a-third-party-backend-and-opt-into-breaking-changes
    Specialised variant of Expression for select clause types
  • Indicates that a type is a SELECT statement.
  • SupportsCombinationClausei-implement-a-third-party-backend-and-opt-into-breaking-changes
    Marker trait used to indicate whenever a backend supports given combination
  • UndecoratedInsertRecordi-implement-a-third-party-backend-and-opt-into-breaking-changes
    Marker trait to indicate that no additional operations have been added to a record for insert.

Functions§

  • Takes a query QueryFragment expression as an argument and returns a type that implements fmt::Display and fmt::Debug to show the query.

Type Aliases§

Derive Macros§