pub enum ColumnDtype {
Integer,
Real,
Text,
}Expand description
The SQLite storage class a column is materialized as.
Inference is “smallest type that fits every non-empty cell” (Phase 21,
crate::ingest): all-integer → ColumnDtype::Integer, else all-numeric
→ ColumnDtype::Real, else ColumnDtype::Text. The Display form is
the SQLite declared type used in CREATE TABLE.
Variants§
Implementations§
Source§impl ColumnDtype
impl ColumnDtype
Sourcepub fn sqlite_decl_type(self) -> &'static str
pub fn sqlite_decl_type(self) -> &'static str
The SQLite declared type written into CREATE TABLE for this dtype.
Identical to the Display form; provided as an
explicit, self-documenting name at the SQL call sites.
Sourcepub fn from_decl_type(decl: &str) -> Self
pub fn from_decl_type(decl: &str) -> Self
Map a SQLite PRAGMA table_info declared type back to a ColumnDtype.
Case-insensitive on the leading token: INTEGER → ColumnDtype::Integer,
REAL (or any REA…/FLOA…/DOUB… numeric affinity) → ColumnDtype::Real,
everything else → ColumnDtype::Text. Used by DataStore::summarize
to recover the dtype of an already-materialized table.