pub struct ColumnInfo {
pub name: String,
pub data_type: DataType,
pub nullable: bool,
pub position: usize,
pub table_name: Option<String>,
pub cql_type: Option<CqlType>,
}Expand description
Information about a column in the result set
Fields§
§name: StringColumn name
data_type: DataTypeColumn data type (flat, kept for backward compatibility)
nullable: boolWhether column can be null
position: usizeColumn position in result set
table_name: Option<String>Original table name (for joined queries)
cql_type: Option<CqlType>Full schema-sourced CQL type (populated when a schema is available).
This field expresses element types for collections (list<int>,
map<text, bigint>), and carries variants absent from the flat
DataType enum (date, time, decimal, varint, counter,
duration, inet). Downstream writers MUST use this over
data_type when it is Some — the no-heuristics mandate (Issue #28)
requires authoritative-schema metadata rather than runtime inference.
Implementations§
Source§impl ColumnInfo
impl ColumnInfo
Sourcepub fn new(
name: String,
data_type: DataType,
nullable: bool,
position: usize,
) -> Self
pub fn new( name: String, data_type: DataType, nullable: bool, position: usize, ) -> Self
Create new column info
Sourcepub fn with_table_name(self, table_name: String) -> Self
pub fn with_table_name(self, table_name: String) -> Self
Set table name
Sourcepub fn with_cql_type(self, cql_type: CqlType) -> Self
pub fn with_cql_type(self, cql_type: CqlType) -> Self
Attach a schema-sourced CqlType to this column.
The data_type field is left unchanged so existing consumers remain
unaffected; downstream writers that need full type fidelity (e.g. the
Parquet/Arrow writer) should prefer cql_type when it is Some.
Sourcepub fn to_json(&self) -> Value
pub fn to_json(&self) -> Value
Convert to JSON representation
The data_type and all pre-existing keys are preserved unchanged for
backward compatibility. The new cql_type key is only emitted when
the field is Some (it is marked skip_serializing_if in the struct
derive, but we also reflect it here for the hand-rolled JSON path).
Trait Implementations§
Source§impl Clone for ColumnInfo
impl Clone for ColumnInfo
Source§fn clone(&self) -> ColumnInfo
fn clone(&self) -> ColumnInfo
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more