pub trait DateTimeColExt<T> {
// Required methods
fn year(&self) -> ColExpr<T>;
fn month(&self) -> ColExpr<T>;
fn day(&self) -> ColExpr<T>;
fn hour(&self) -> ColExpr<T>;
fn minute(&self) -> ColExpr<T>;
fn second(&self) -> ColExpr<T>;
fn week_day(&self) -> ColExpr<T>;
}Expand description
Date-extract helpers — year(), month(), day().
Backend dispatch is hidden inside the returned ColExpr: the
Postgres form uses CAST(EXTRACT(<part> FROM col) AS INTEGER);
the SQLite form uses CAST(strftime('<fmt>', col) AS INTEGER).
Both forms land in the same ColExpr; Predicate picks the
right one at terminal time based on the resolved pool.
Required Methods§
Sourcefn second(&self) -> ColExpr<T>
fn second(&self) -> ColExpr<T>
Second of minute, 0..=59 (whole seconds; subsecond fragments are truncated by the cast).
Sourcefn week_day(&self) -> ColExpr<T>
fn week_day(&self) -> ColExpr<T>
Day of week. Numbering differs by backend to keep each
dialect’s native form: Postgres EXTRACT(DOW ...) returns
0=Sunday..6=Saturday; SQLite strftime('%w', ...) matches
that numbering too, so both backends agree. Use this for
“rows posted on weekends” / “rows posted on a Friday” style
queries — compare against the integer (week_day().eq(5)
for Friday).
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".