pub struct DerivedColumn<E: Entity> { /* private fields */ }Expand description
A column computed dynamically based on other columns or expressions.
Implementations§
Source§impl<E: Entity> DerivedColumn<E>
impl<E: Entity> DerivedColumn<E>
Sourcepub fn coalesce<V: IntoSqlValue>(col: E::Column, value: V) -> Self
pub fn coalesce<V: IntoSqlValue>(col: E::Column, value: V) -> Self
Constructs an instance using COALESCE to provide a default value for the column.
Sourcepub fn coalesce_aggregation<V: IntoSqlValue>(
aggregation: Aggregation<E>,
value: V,
) -> Self
pub fn coalesce_aggregation<V: IntoSqlValue>( aggregation: Aggregation<E>, value: V, ) -> Self
Constructs an instance using COALESCE to provide a default value for the aggregation.
Sourcepub fn year(col: E::Column) -> Self
pub fn year(col: E::Column) -> Self
Constructs an instance for extracting the year from a column.
Sourcepub fn year_month(col: E::Column) -> Self
pub fn year_month(col: E::Column) -> Self
Constructs an instance for extracting the year-month from a column.
Sourcepub fn date(col: E::Column) -> Self
pub fn date(col: E::Column) -> Self
Constructs an instance for extracting the date from a column.
Sourcepub fn format_date_time(col: E::Column) -> Self
pub fn format_date_time(col: E::Column) -> Self
Constructs an instance for formating a date-time as %Y-%m-%d %H:%M:%S.
Sourcepub fn json_extract(col: E::Column, path: &str) -> Self
pub fn json_extract(col: E::Column, path: &str) -> Self
Constructs an instance for extracting values from a JSON column.
Trait Implementations§
Source§impl<E: Clone + Entity> Clone for DerivedColumn<E>
impl<E: Clone + Entity> Clone for DerivedColumn<E>
Source§fn clone(&self) -> DerivedColumn<E>
fn clone(&self) -> DerivedColumn<E>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<E: Entity> Display for DerivedColumn<E>
impl<E: Entity> Display for DerivedColumn<E>
Source§impl<E: Entity> ModelColumn<E> for DerivedColumn<E>
impl<E: Entity> ModelColumn<E> for DerivedColumn<E>
Source§fn into_column_expr(self) -> String
fn into_column_expr(self) -> String
Converts
self into a column expression.impl<E: Entity> StructuralPartialEq for DerivedColumn<E>
Auto Trait Implementations§
impl<E> Freeze for DerivedColumn<E>
impl<E> RefUnwindSafe for DerivedColumn<E>where
E: RefUnwindSafe,
impl<E> Send for DerivedColumn<E>where
E: Send,
impl<E> Sync for DerivedColumn<E>where
E: Sync,
impl<E> Unpin for DerivedColumn<E>where
E: Unpin,
impl<E> UnwindSafe for DerivedColumn<E>where
E: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Casing<T> for T
impl<T> Casing<T> for T
Source§fn to_case(&self, case: Case<'_>) -> String
fn to_case(&self, case: Case<'_>) -> String
Convert the string into the given case. It will reference
self and create a new
String with the same pattern and delimeter as case. It will split on boundaries
defined at Boundary::defaults(). Read moreSource§fn set_boundaries(&self, bs: &[Boundary]) -> StateConverter<'_, T>
fn set_boundaries(&self, bs: &[Boundary]) -> StateConverter<'_, T>
Creates a
StateConverter struct initialized with the boundaries provided. Read moreSource§fn remove_boundaries(&self, bs: &[Boundary]) -> StateConverter<'_, T>
fn remove_boundaries(&self, bs: &[Boundary]) -> StateConverter<'_, T>
Creates a
StateConverter struct initialized without the boundaries
provided. Read moreSource§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more