Rindle docs and package mapSkip to main content

ColType

Enum ColType 

pub enum ColType {
    String,
    Number,
    Boolean,
    Json,
    Int,
}
Expand description

A column’s declared type (from the host schema) — drives SQLite affinity at DDL time.

Variants§

§

String

§

Number

§

Boolean

§

Json

§

Int

The declared exact-i64 plane (design 226): follower DDL renders INTEGER and data cells replicate variant-faithfully with no f64 round-trip bound. Not yet producible from a decltype — BIGINT/INT8 stay refused until 226 Stage C4 lifts the refusal.

Implementations§

§

impl ColType

pub fn wire_name(self) -> &'static str

The client-schema vocabulary (@rindle/client’s ColType = string|number|boolean|json, plus 226’s int64, packages/client/src/types.ts) — what /schema codegen emits per column.

pub fn from_sqlite_decl(decl: &str) -> ColType

The ColType a table introspected from the live file carries (register_existing_table), derived from a column’s declared SQLite type. SQLite stores the full declared type text verbatim (pragma_table_info), so the mapping is two-tier:

  1. App-level intent, when the declared name encodes it: BOOL/BOOLEANBoolean, JSONJson. This recovers the boolean/json kind from hand-written (or richer-ORM) DDL, and mirrors value_type_of (schema_envelope.rs, this crate) so the wire ColType agrees with the ValueType the comparator already uses — and so rindle schema gen emits boolean()/json() for these columns rather than number()/string().
  2. SQLite affinity otherwise (the standard rules, https://www.sqlite.org/datatype3.html#determination_of_column_affinity): INT*Number, CHAR/CLOB/TEXTString, REAL/NUMERICNumber. BLOB/untyped surface as String (there is no ColType::Blob, design §7.1).

Only DDL that does not encode the kind in the type name stays lossy: a column you intend as a boolean but declare bare INTEGER still reports number (declare it BOOLEAN to carry the intent — drizzle-kit emits only storage classes; see DRIZZLE-MIGRATIONS-DESIGN.md §6.2).

Trait Implementations§

§

impl Clone for ColType

§

fn clone(&self) -> ColType

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
§

impl Debug for ColType

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
§

impl PartialEq for ColType

§

fn eq(&self, other: &ColType) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
§

impl Copy for ColType

§

impl Eq for ColType

§

impl StructuralPartialEq for ColType

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,