Skip to main content

Module kalam_cell_value

Module kalam_cell_value 

Source
Expand description

KalamCellValue — type-safe wrapper for individual cell values

Replaces raw serde_json::Value in query results and subscription notifications while keeping the exact same JSON wire format via #[serde(transparent)].

§Two row shapes, one cell type

Query results  → Vec<Vec<KalamCellValue>>          (positional)
Subscriptions  → HashMap<String, KalamCellValue>   (named)

§Typed accessors — one per KalamDataType

Call the method that matches the column’s declared KalamDataType:

KalamDataTypeMethodReturn type
Textas_text()Option<&str>
Booleanas_boolean()Option<bool>
SmallIntas_small_int()Option<i16>
Intas_int()Option<i32>
BigIntas_big_int()Option<i64>
Floatas_float()Option<f32>
Doubleas_double()Option<f64>
Decimalas_decimal()Option<f64>
Timestampas_timestamp()Option<i64> (µs since epoch)
Dateas_date()Option<i32> (days since epoch)
DateTimeas_datetime()Option<i64> (µs since epoch)
Timeas_time()Option<i64> (µs since midnight)
Uuidas_uuid()Option<&str>
Jsonas_json()Option<&JsonValue>
Bytesas_bytes()Option<Vec<u8>> (base64-decoded)
Embeddingas_embedding()Option<Vec<f32>>
Fileas_file()Option<FileRef>

§Wire format

Serializes identically to serde_json::Value — no breaking changes:

"Alice"          // Text / Uuid
42               // Int / BigInt
true             // Boolean
null             // Null
"1699000000000"  // Timestamp (string-encoded for i64 precision)
{"id":"..."}     // File column (JSON object)

Structs§

KalamCellValue
A single cell value in a query result row or subscription notification.

Type Aliases§

RowData
Type alias for a subscription row — named columns.