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:
| KalamDataType | Method | Return type |
|---|---|---|
| Text | as_text() | Option<&str> |
| Boolean | as_boolean() | Option<bool> |
| SmallInt | as_small_int() | Option<i16> |
| Int | as_int() | Option<i32> |
| BigInt | as_big_int() | Option<i64> |
| Float | as_float() | Option<f32> |
| Double | as_double() | Option<f64> |
| Decimal | as_decimal() | Option<f64> |
| Timestamp | as_timestamp() | Option<i64> (µs since epoch) |
| Date | as_date() | Option<i32> (days since epoch) |
| DateTime | as_datetime() | Option<i64> (µs since epoch) |
| Time | as_time() | Option<i64> (µs since midnight) |
| Uuid | as_uuid() | Option<&str> |
| Json | as_json() | Option<&JsonValue> |
| Bytes | as_bytes() | Option<Vec<u8>> (base64-decoded) |
| Embedding | as_embedding() | Option<Vec<f32>> |
| File | as_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§
- Kalam
Cell Value - A single cell value in a query result row or subscription notification.
Type Aliases§
- RowData
- Type alias for a subscription row — named columns.