Types & Models
This page documents the most important public types re-exported by kalam-client from link-common.
Query models
QueryResponse
Returned by execute_query, execute_with_files, and related SQL helpers.
status: ResponseStatus—SuccessorErrorresults: Vec<QueryResult>— one per executed statementtook: Option<f64>— execution time in millisecondserror: Option<ErrorDetail>— populated whenstatusis error
Helpers:
success()→boolis_token_expired()→boolrows_as_maps()→ first result asVec<HashMap<String, KalamCellValue>>rows()→ first result as positionalVec<Vec<KalamCellValue>>row_count(),first_row_as_map(),get_value(...),get_i64(...)
QueryResult
schema— column metadata (SchemaField)rows: Option<Vec<Vec<KalamCellValue>>>— positional row storagerow_count: usizemessage: Option<String>
row_as_map(index) builds a named row map for one index.
SchemaField
Column metadata with flag helpers for primary key, nullability, and uniqueness.
Authentication models
LoginResponse
Returned by login and refresh_access_token (requires auth-flows):
access_token: Stringrefresh_token: Option<String>expires_at/refresh_expires_at— server-provided timestampsuser—LoginUserInfo
AuthProvider
Enum: BasicAuth, JwtToken, None.
Construct with basic_auth, jwt_token, system_user_auth, or none.
ResolvedAuth
Internal resolved state: static provider or dynamic ArcDynAuthProvider.
Subscription models
SubscriptionConfig
id— subscription namequery— live SQL stringoptions: Option<SubscriptionOptions>—last_rows,batch_size,from(SeqId)
SubscriptionOptions
Builder-style helpers: with_last_rows, with_batch_size, with_from.
LiveRowsConfig
Client-side materializer settings — primarily limit: Option<usize>.
LiveRowsEvent
Rows { rows, last_seq_id, .. }— materialized snapshotError { code, message, .. }— subscription failure
ChangeEvent
Low-level protocol events from live_events():
Insert,Update,Deletewith row payloads- Additional control/ack variants for protocol tooling
SubscriptionInfo
Returned by client.subscriptions() — active subscription id and query text.
Consumer models (feature consumer)
ConsumerBuilder— fluent builder fromclient.consumer()TopicConsumer—poll(),mark_processed(),commit_sync(),close()ConsumerConfig,AutoOffsetResetConsumeMessage,ConsumeRequest,ConsumeResponse,AckResponse
Connection models
EventHandlers
Lifecycle callbacks — see Client Lifecycle.
ConnectionOptions
HTTP/WebSocket behavior including ws_lazy_connect, compression, keepalive, and HttpVersion.
KalamLinkTimeouts
Receive/send timeouts for HTTP and WebSocket operations.
Error type
KalamLinkError — library error enum. Result<T> is std::result::Result<T, KalamLinkError>.
Common variants: configuration errors, authentication errors, server HTTP errors, subscription errors, SetupRequired (HTTP 428 on login).
FILE column models
FileRef
Table-agnostic metadata stored in FILE column JSON (from kalamdb-commons):
id,sub,name,size,mime,sha256, optionalshardstored_name(),relative_path(),format_size(), MIME type helpersdownload_url(base_url, namespace, table)andrelative_url(namespace, table)when namespace/table are known as strings
Parse from cells with KalamCellValue::as_file().
TableId
Type-safe namespace + table identity (from kalamdb-commons, re-exported by kalam-client):
Use one TableId when binding many FILE cells from the same table.
FileRefContext
Wraps a TableId for download context. Construct with FileRefContext::new(table_id) or FileRefContext::from_strings(namespace, table).
BoundFileRef
FileRef plus table context. Derefs to FileRef.
table_id(),namespace(),table()download_url(base_url),relative_url()— no extra namespace/table argsfile_ref()— borrow underlyingFileRef
Parse from cells with KalamCellValue::as_bound_file(&table_id).
FileUpload
Multipart payload for FILE("placeholder") SQL — FileUpload::new(placeholder, filename, bytes) plus optional with_mime.
FileDownload
Response from download_bound_file() / download_file():
bytes,content_type,content_disposition
IDs
SeqId— subscription resume cursor (fromkalamdb_commons)TableId— namespace + table composite keyUserId,Role— re-exported domain types