Module diesel::expression [] [src]

AST types representing various typed SQL expressions.

Almost all types implement either Expression or AsExpression.

The most common expression to work with is a Column. There are various methods that you can call on these, found in expression_methods. You can also call numeric operators on expressions of the appropriate type.

Any primitive which implements ToSql will also implement AsExpression, allowing it to be used as an argument to any of the methods described here.

Modules

helper_types

The types in this module are all shorthand for PredicateType<Lhs, AsExpr<Rhs, Lhs>>. Since we often need to return concrete types, instead of a boxed trait object, these can be useful for writing concise return types.

Structs

SqlLiteral

Returned by the sql() function.

Traits

AppearsOnTable

Indicates that all elements of an expression are valid given a from clause.

AsExpression

Converts a type to its representation for use in Diesel's query builder.

BoxableExpression

Helper trait used when boxing expressions.

Expression

Represents a typed fragment of SQL.

IntoSql

Converts a type to its representation for use in Diesel's query builder.

NonAggregate

Marker trait to indicate that an expression does not include any aggregate functions.

SelectableExpression

Indicates that an expression can be selected from a source.