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
impl ColType
pub fn wire_name(self) -> &'static str
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
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:
- App-level intent, when the declared name encodes it:
BOOL/BOOLEAN→Boolean,JSON→Json. This recovers theboolean/jsonkind from hand-written (or richer-ORM) DDL, and mirrorsvalue_type_of(schema_envelope.rs, this crate) so the wireColTypeagrees with theValueTypethe comparator already uses — and sorindle schema genemitsboolean()/json()for these columns rather thannumber()/string(). - SQLite affinity otherwise (the standard rules,
https://www.sqlite.org/datatype3.html#determination_of_column_affinity):
INT*→Number,CHAR/CLOB/TEXT→String,REAL/NUMERIC→Number. BLOB/untyped surface asString(there is noColType::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 Copy for ColType
impl Eq for ColType
impl StructuralPartialEq for ColType
Auto Trait Implementations§
impl Freeze for ColType
impl RefUnwindSafe for ColType
impl Send for ColType
impl Sync for ColType
impl Unpin for ColType
impl UnsafeUnpin for ColType
impl UnwindSafe for ColType
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.