pub enum DataType {
Integer,
Text,
Real,
Bool,
Vector(usize),
None,
Invalid,
}Expand description
SQLRite data types Mapped after SQLite Data Type Storage Classes and SQLite Affinity Type (Datatypes In SQLite Version 3)[https://www.sqlite.org/datatype3.html]
Vector(dim) is the Phase 7a addition — a fixed-dimension dense f32
array. The dimension is part of the type so a VECTOR(384) column
rejects [0.1, 0.2, 0.3] at INSERT time as a clean type error
rather than silently storing the wrong shape.
Variants§
Integer
Text
Real
Bool
Vector(usize)
Dense f32 vector of fixed dimension. The usize is the column’s
declared dimension; every value stored in the column must have
exactly that many elements.
None
Invalid
Implementations§
Source§impl DataType
impl DataType
Sourcepub fn new(cmd: String) -> DataType
pub fn new(cmd: String) -> DataType
Constructs a DataType from the wire string the parser produces.
Pre-Phase-7 the strings were one-of "integer" | "text" | "real" | "bool" | "none". Phase 7a adds "vector(N)" (case-insensitive,
N a positive integer) for the new vector column type — encoded
in-band so we don’t have to plumb a richer type through the
existing string-based ParsedColumn pipeline.
Sourcepub fn to_wire_string(&self) -> String
pub fn to_wire_string(&self) -> String
Inverse of new — returns the canonical lowercased wire string
for this DataType. Used by the parser to round-trip
VECTOR(N) → DataType::Vector(N) → "vector(N)" into
ParsedColumn::datatype so the rest of the pipeline keeps
working with strings.