#[non_exhaustive]pub enum OrderByFieldType {
Text,
Integer,
Numeric,
Boolean,
DateTime,
Date,
Time,
}Expand description
SQL sort type for ORDER BY cast generation.
Determines whether the SQL generator wraps the extracted JSONB text in a
type cast (e.g., (data->>'amount')::numeric) to ensure correct sort order.
Without a cast, all JSONB extractions are text and sort lexicographically,
which is wrong for numeric and date/time fields ("9" > "10").
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Text
No cast — text/string sort (correct for strings, UUIDs, enum values).
Integer
Cast to integer type (::bigint / CAST(... AS BIGINT)).
Numeric
Cast to floating-point/numeric type (::numeric / CAST(... AS DECIMAL(38,12))).
Boolean
Cast to boolean (::boolean / CAST(... AS UNSIGNED)).
DateTime
Cast to timestamp (::timestamptz / CAST(... AS DATETIME)).
Also used for ISO-8601 date-time strings which sort correctly as text,
but the cast ensures the database optimizer can use typed comparisons.
Date
Cast to date (::date / CAST(... AS DATE)).
Time
Cast to time (::time / CAST(... AS TIME)).
Trait Implementations§
Source§impl Clone for OrderByFieldType
impl Clone for OrderByFieldType
Source§fn clone(&self) -> OrderByFieldType
fn clone(&self) -> OrderByFieldType
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for OrderByFieldType
impl Debug for OrderByFieldType
Source§impl Default for OrderByFieldType
impl Default for OrderByFieldType
Source§fn default() -> OrderByFieldType
fn default() -> OrderByFieldType
Source§impl<'de> Deserialize<'de> for OrderByFieldType
impl<'de> Deserialize<'de> for OrderByFieldType
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl PartialEq for OrderByFieldType
impl PartialEq for OrderByFieldType
Source§impl Serialize for OrderByFieldType
impl Serialize for OrderByFieldType
impl Copy for OrderByFieldType
impl Eq for OrderByFieldType
impl StructuralPartialEq for OrderByFieldType
Auto Trait Implementations§
impl Freeze for OrderByFieldType
impl RefUnwindSafe for OrderByFieldType
impl Send for OrderByFieldType
impl Sync for OrderByFieldType
impl Unpin for OrderByFieldType
impl UnsafeUnpin for OrderByFieldType
impl UnwindSafe for OrderByFieldType
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.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>
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>
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