Module diesel::query_dsl [] [src]

Traits that construct SELECT statements

Traits in this module have methods that generally map to the keyword for the corresponding clause in SQL, unless it conflicts with a Rust keyword (such as WHERE/where).

See also expression_methods and dsl.

Traits

BelongingToDsl

Constructs a query that finds record(s) based on directional association with other record(s).

BoxedDsl

Boxes the pieces of a query into a single type. This is useful for cases where you want to conditionally modify a query, but need the type to remain the same. The backend must be specified as part of this. It is not possible to box a query and have it be useable on multiple backends.

CountDsl

Adds a simple count function to queries. Automatically implemented for all types which implement SelectDsl.

DistinctDsl

Adds the DISTINCT keyword to a query.

DistinctOnDsl

Adds the DISTINCT ON clause to a query.

ExecuteDsl
FilterDsl

Adds to the WHERE clause of a query. If there is already a WHERE clause, the result will be old AND new. This is automatically implemented for the various query builder types.

FindDsl

Attempts to find a single record from the given table by primary key.

FirstDsl
ForUpdateDsl

Adds FOR UPDATE to the end of the select statement. This method is only available for MySQL and PostgreSQL. SQLite does not provide any form of row locking.

JoinDsl

Methods allowing various joins between two or more tables.

JoinOnDsl
LimitDsl

Sets the limit clause of a query. If there was already a limit clause, it will be overridden. This is automatically implemented for the various query builder types.

LoadDsl

Methods to execute a query given a connection. These are automatically implemented for the various query types.

LoadQuery
OffsetDsl

Sets the offset clause of a query. If there was already a offset clause, it will be overridden. This is automatically implemented for the various query builder types.

OrderDsl

Sets the order clause of a query. If there was already a order clause, it will be overridden. The expression passed to order must actually be valid for the query. See also: .desc() and .asc()

SaveChangesDsl
SelectDsl

Sets the select clause of a query. If there was already a select clause, it will be overridden. The expression passed to select must actually be valid for the query (only contains columns from the target table, doesn't mix aggregate + non-aggregate expressions, etc).