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§
- bind_
collector - Types related to managing bind parameters during query construction.
Structs§
- All
i-implement-a-third-party-backend-and-opt-into-breaking-changes
- Keep duplicate rows in the result
- AstPass
- The primary type used when walking a Diesel AST during query execution.
- AstPass
ToSql Options i-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. - Batch
Insert 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.
- Boxed
Limit Offset Clause i-implement-a-third-party-backend-and-opt-into-breaking-changes
- A boxed variant of
LimitOffsetClause
- Boxed
Select Statement i-implement-a-third-party-backend-and-opt-into-breaking-changes
- This type represents a boxed select query
- Boxed
SqlQuery - See
SqlQuery::into_boxed
. - Collected
Query i-implement-a-third-party-backend-and-opt-into-breaking-changes
- A SQL query variant with already collected bind data which can be moved
- Debug
Query - A struct that implements
fmt::Display
andfmt::Debug
to show the SQL representation of a query. - Default
Values i-implement-a-third-party-backend-and-opt-into-breaking-changes
- Delete
Statement - Represents a SQL
DELETE
statement. - Distinct
i-implement-a-third-party-backend-and-opt-into-breaking-changes
- Remove duplicate rows in the result, this is the default behavior of
UNION
,INTERSECT
andEXCEPT
- Except
i-implement-a-third-party-backend-and-opt-into-breaking-changes
- Computes the set difference of the rows returned by the involved
SELECT
statements using SQLEXCEPT
- From
Clause i-implement-a-third-party-backend-and-opt-into-breaking-changes
- Incomplete
Insert Statement - The structure returned by
insert_into
. - Insert
OrIgnore i-implement-a-third-party-backend-and-opt-into-breaking-changes
- A marker type for insert or ignore statements
- Insert
Statement i-implement-a-third-party-backend-and-opt-into-breaking-changes
- A fully constructed insert statement.
- Intersect
i-implement-a-third-party-backend-and-opt-into-breaking-changes
- Computes the set intersection of the rows returned by the involved
SELECT
statements using SQLINTERSECT
- Limit
Clause i-implement-a-third-party-backend-and-opt-into-breaking-changes
- A query node representing a limit clause
- Limit
Offset Clause i-implement-a-third-party-backend-and-opt-into-breaking-changes
- A helper query node that contains both limit and offset clauses
- NoFrom
Clause i-implement-a-third-party-backend-and-opt-into-breaking-changes
- This type represents a not existing from clause
- NoLimit
Clause i-implement-a-third-party-backend-and-opt-into-breaking-changes
- A query node indicating the absence of a limit clause
- NoOffset
Clause i-implement-a-third-party-backend-and-opt-into-breaking-changes
- A query node indicating the absence of an offset clause
- NoOrder
Clause i-implement-a-third-party-backend-and-opt-into-breaking-changes
- DSL node that represents that no order clause is set
- Offset
Clause 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 an
ONLY
clause. - Order
Clause i-implement-a-third-party-backend-and-opt-into-breaking-changes
- DSL node that represents that an order clause is set
- Parenthesis
Wrapper i-implement-a-third-party-backend-and-opt-into-breaking-changes
- Wrapper used to wrap rhs sql in parenthesis when supported by backend
- Replace
i-implement-a-third-party-backend-and-opt-into-breaking-changes
- A marker type for replace statements
- Returning
Clause i-implement-a-third-party-backend-and-opt-into-breaking-changes
- This type represents a SQL
Returning
clause - Select
Statement i-implement-a-third-party-backend-and-opt-into-breaking-changes
- This type represents a select query
- SqlQuery
- The return value of
sql_query
. - Tablesample
postgres_backend
- Represents a query with a
TABLESAMPLE
clause. - Union
i-implement-a-third-party-backend-and-opt-into-breaking-changes
- Computes the set union of the rows returned by the involved
SELECT
statements using SQLUNION
- Update
Statement - Represents a complete
UPDATE
statement. - Update
Target - Values
Clause i-implement-a-third-party-backend-and-opt-into-breaking-changes
- This type represents a values clause used as part of insert statements
Traits§
- AsChangeset
- Types which can be passed to
update.set
. - AsQuery
- Types that can be converted into a complete, typed SQL query.
- Bind
Collector - A type which manages serializing bind parameters during query construction.
- Decoratable
Target - Interface to add information to conflict targets. Designed to be open for further additions to conflict targets like constraints
- Into
Boxed Clause - A trait used to construct type erased boxed variant of the current query node
- Into
Update Target - A type which can be passed to
update
ordelete
. - Moveable
Bind Collector i-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.
- Query
- A complete SQL query with a return type.
- Query
Builder - Constructs a SQL query from a Diesel AST.
- Query
Fragment - An untyped fragment of SQL.
- QueryId
- Uniquely identifies queries by their type for the purpose of prepared statement caching.
- Select
Clause Expression i-implement-a-third-party-backend-and-opt-into-breaking-changes
- Specialised variant of
Expression
for select clause types - Select
Query - Indicates that a type is a
SELECT
statement. - Supports
Combination Clause i-implement-a-third-party-backend-and-opt-into-breaking-changes
- Marker trait used to indicate whenever a backend supports given combination
- Undecorated
Insert Record 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§
- debug_
query - Takes a query
QueryFragment
expression as an argument and returns a type that implementsfmt::Display
andfmt::Debug
to show the query.
Type Aliases§
- Boxed
Delete Statement - A
DELETE
statement with a boxedWHERE
clause - Boxed
Update Statement - An
UPDATE
statement with a boxedWHERE
clause. - Build
Query Result - A specialized Result type used with the query builder.
- Incomplete
Insert OrIgnore Statement - Represents the return type of
diesel::insert_or_ignore_into
- Incomplete
Replace Statement - Represents the return type of
diesel::replace_into
- Insert
OrIgnore Statement - Represents a complete
INSERT OR IGNORE
statement. - Replace
Statement - Represents a complete
INSERT OR REPLACE
statement.
Derive Macros§
- AsChangeset
- Implements
AsChangeset
- QueryId
- Implements
QueryId