Module diesel::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.
Modules§
- Types related to managing bind parameters during query construction.
Structs§
- The primary type used when walking a Diesel AST during query execution.
- AstPassToSqlOptions
i-implement-a-third-party-backend-and-opt-into-breaking-changes
This is used to pass down additional settings to theAstPass
when rendering the sql string. - BatchInsert
i-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. - BoxedLimitOffsetClause
i-implement-a-third-party-backend-and-opt-into-breaking-changes
A boxed variant ofLimitOffsetClause
- BoxedSelectStatement
i-implement-a-third-party-backend-and-opt-into-breaking-changes
This type represents a boxed select query - See
SqlQuery::into_boxed
. - A struct that implements
fmt::Display
andfmt::Debug
to show the SQL representation of a query. - DefaultValues
i-implement-a-third-party-backend-and-opt-into-breaking-changes
- Represents a SQL
DELETE
statement. - FromClause
i-implement-a-third-party-backend-and-opt-into-breaking-changes
- The structure returned by
insert_into
. - InsertStatement
i-implement-a-third-party-backend-and-opt-into-breaking-changes
A fully constructed insert statement. - LimitClause
i-implement-a-third-party-backend-and-opt-into-breaking-changes
A query node representing a limit clause - LimitOffsetClause
i-implement-a-third-party-backend-and-opt-into-breaking-changes
A helper query node that contains both limit and offset clauses - NoFromClause
i-implement-a-third-party-backend-and-opt-into-breaking-changes
This type represents a not existing from clause - NoLimitClause
i-implement-a-third-party-backend-and-opt-into-breaking-changes
A query node indicating the absence of a limit clause - NoOffsetClause
i-implement-a-third-party-backend-and-opt-into-breaking-changes
A query node indicating the absence of an offset clause - OffsetClause
i-implement-a-third-party-backend-and-opt-into-breaking-changes
A query node representing an offset clause - Only
postgres_backend
Represents a query with anONLY
clause. - ReturningClause
i-implement-a-third-party-backend-and-opt-into-breaking-changes
This type represents a SQLReturning
clause - SelectStatement
i-implement-a-third-party-backend-and-opt-into-breaking-changes
This type represents a select query - The return value of
sql_query
. - Represents a complete
UPDATE
statement. - ValuesClause
i-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 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.
- SelectClauseExpression
i-implement-a-third-party-backend-and-opt-into-breaking-changes
Specialised variant ofExpression
for select clause types - Indicates that a type is a
SELECT
statement. - UndecoratedInsertRecord
i-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 implementsfmt::Display
andfmt::Debug
to show the query.
Type Aliases§
- A
DELETE
statement with a boxedWHERE
clause - An
UPDATE
statement with a boxedWHERE
clause. - A specialized Result type used with the query builder.
- Represents the return type of
diesel::insert_or_ignore_into
- Represents the return type of
diesel::replace_into
- Represents a complete
INSERT OR IGNORE
statement. - Represents a complete
INSERT OR REPLACE
statement.
Derive Macros§
- Implements
AsChangeset
- Implements
QueryId