pub trait IntoExpr<'column, S> {
type Typ: DbTyp;
// Required method
fn into_expr(self) -> Expr<'column, S, Self::Typ>;
}Expand description
Trait for all values that can be used as expressions in queries.
There is a hierarchy of types that can be used to build queries.
- TableRow, i64, f64, bool,
&[u8],&str: These are the base types for building expressions. They all implement IntoExpr and are Copy. Note that TableRow is special because it refers to a table row that is guaranteed to exist. - Expr is the type that all IntoExpr values can be converted into. It has a lot of methods to combine expressions into more complicated expressions. Next to those, it implements std::ops::Deref, if the expression is a table expression. This can be used to get access to the columns of the table, which can themselves be table expressions. Note that combinators like crate::optional and crate::aggregate also have Expr as return type.
Note that while Expr implements IntoExpr, you may want to use &Expr instead.
Using a reference lets you reuse Expr without calling Clone explicitly.
Required Associated Types§
Required Methods§
Implementations on Foreign Types§
Source§impl<'column, S> IntoExpr<'column, S> for Date
Available on crate feature jiff-02 only.Note that dates before 0000-01-01 can not be used in an expression.
The reason is that dates are represented in sqlite as strings and for negative
years the sorting order is wrong.
impl<'column, S> IntoExpr<'column, S> for Date
Available on crate feature
jiff-02 only.Note that dates before 0000-01-01 can not be used in an expression.
The reason is that dates are represented in sqlite as strings and for negative
years the sorting order is wrong.
Source§impl<'column, S> IntoExpr<'column, S> for Timestamp
Available on crate feature jiff-02 only.Note that timestamps before 0000-01-01 00:00:00 can not be used in an expression.
The reason is that datetimes are represented in sqlite as strings and for negative
years the sorting order is wrong.
impl<'column, S> IntoExpr<'column, S> for Timestamp
Available on crate feature
jiff-02 only.Note that timestamps before 0000-01-01 00:00:00 can not be used in an expression.
The reason is that datetimes are represented in sqlite as strings and for negative
years the sorting order is wrong.
The conversion is lossless, everything up to nanoseconds is preserved.