pub enum ColumnKind {
Basic(ColumnType),
Varchar(u32),
Json,
Decimal {
precision: u32,
scale: u32,
},
}Expand description
What a column holds.
The shared subset delegates to the same mapping an
Entity’s columns use, so a table built here and a table
derived from a model cannot disagree about what Text renders as.
Variants§
Basic(ColumnType)
One of the types an entity field can have.
Varchar(u32)
VARCHAR(n) — a length an entity cannot express.
Json
A JSON document. JSONB on Postgres, JSON on MySQL, TEXT on SQLite.
Decimal
A fixed-point number.
DECIMAL(p, s) on MySQL and Postgres. SQLite has no such type and
renders REAL, which is a float — so an amount stored there is subject
to the rounding this type exists to avoid. Store money as integer minor
units if SQLite is a target you care about.
Trait Implementations§
Source§impl Clone for ColumnKind
impl Clone for ColumnKind
Source§fn clone(&self) -> ColumnKind
fn clone(&self) -> ColumnKind
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for ColumnKind
Source§impl Debug for ColumnKind
impl Debug for ColumnKind
Source§impl PartialEq for ColumnKind
impl PartialEq for ColumnKind
impl StructuralPartialEq for ColumnKind
Auto Trait Implementations§
impl Freeze for ColumnKind
impl RefUnwindSafe for ColumnKind
impl Send for ColumnKind
impl Sync for ColumnKind
impl Unpin for ColumnKind
impl UnsafeUnpin for ColumnKind
impl UnwindSafe for ColumnKind
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Event for T
impl<T> Event for T
Source§fn event_name() -> &'static strwhere
Self: Sized,
fn event_name() -> &'static strwhere
Self: Sized,
A human-readable name, used by wildcard listeners and log output.
Always the Rust type path; see the trait docs.