pub enum CanonicalType {
}Expand description
Standard logical types that package configs may declare.
All string aliases accepted in JSON are normalised to one of these variants by
parse_canonical. Unknown strings fall through to CanonicalType::Custom so that
existing packages using raw SQL type names continue to work unchanged.
Variants§
Text
Unbounded unicode text (TEXT / VARCHAR without limit).
Varchar(Option<u32>)
Variable-length text with optional length cap.
Char(Option<u32>)
Fixed-length text.
SmallInt
16-bit integer.
Int
32-bit integer.
BigInt
64-bit integer.
Real
32-bit floating point.
Double
64-bit floating point (default for "float").
Decimal(Option<(u8, u8)>)
Fixed-precision decimal. Params: (precision, scale).
Boolean
Boolean true/false.
Uuid
UUID (128-bit universally unique identifier).
Json
JSON document. Dialects may use a richer binary form (e.g. JSONB in Postgres).
Jsonb
Explicitly request the binary JSON form where available; degrades to JSON/TEXT elsewhere.
Timestamp
Timestamp with time zone. Always stores timezone information.
TimestampNtz
Timestamp without time zone (use sparingly — prefer CanonicalType::Timestamp).
Date
Calendar date (no time component).
Time
Time of day without time zone.
Timetz
Time of day with time zone.
Bytes
Binary data.
Serial
Auto-incrementing 32-bit integer primary key.
BigSerial
Auto-incrementing 64-bit integer primary key.
Asset
SDK pseudo-type: a single asset stored as a relative path string.
AssetArray
SDK pseudo-type: a list of assets stored as a JSON array of path strings.
Array(Box<CanonicalType>)
Typed array of another canonical type (e.g. text[], uuid[]).
Custom(String)
Pass-through for schema-qualified enums (e.g. "myschema.status") and any raw SQL
type string not matched by the canonical parser. Rendered verbatim in DDL.
Trait Implementations§
Source§impl Clone for CanonicalType
impl Clone for CanonicalType
Source§fn clone(&self) -> CanonicalType
fn clone(&self) -> CanonicalType
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for CanonicalType
impl Debug for CanonicalType
Source§impl PartialEq for CanonicalType
impl PartialEq for CanonicalType
impl StructuralPartialEq for CanonicalType
Auto Trait Implementations§
impl Freeze for CanonicalType
impl RefUnwindSafe for CanonicalType
impl Send for CanonicalType
impl Sync for CanonicalType
impl Unpin for CanonicalType
impl UnsafeUnpin for CanonicalType
impl UnwindSafe for CanonicalType
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,
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
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