Skip to main content

Module msgpack_codec

Module msgpack_codec 

Source
Expand description

MessagePack codec for the Triplox HTTP/2 wire protocol.

Each HTTP body is a single msgpack value. DataType primitives map to native msgpack types (bool, int, float, str, bin, array, map). Triplox-specific types use ext type codes:

Ext codeTypePayload
-1Instantmsgpack Timestamp (4/8/12 bytes, nanosecond)
1BigInt16 bytes, big-endian i128
2Uuid16 bytes, RFC 4122 raw
3KeywordUTF-8 “ns/name” (no leading :)

Tagged unions (EntityRef, TxOp, QueryArg) use {"kind": "<variant>", ...} maps.

Structs§

ErrorResponseBody
ExecuteRequest
OpenDbRequest
QueryRequest
QueryResponse
SubscribeRequest
TxResultResponse

Enums§

SubscriptionFrame
One frame in a subscription response stream. Frames are bare, self-delimiting msgpack maps tagged by a kind discriminator.

Constants§

EXT_BIGINT
EXT_KEYWORD
EXT_TIMESTAMP
EXT_UUID

Functions§

data_type_from_value
decode_error_body
decode_execute_request
decode_open_db_request
decode_query_request
decode_query_response
decode_subscribe_request
decode_subscription_frame
Decode one subscription frame from a complete msgpack value buffer.
decode_tx_key
decode_tx_result_response
encode_error_body
Encode an ErrorResponse body.
encode_execute_request
Encode an Execute request: {"ops": [TxOp, ...]}.
encode_open_db_request
Encode an OpenDb request: {"tx_id": int|nil, "system_time": Timestamp|nil}.
encode_query_request
Encode a Query request: {"tx_key": TxKey, "query": str, "args": [QueryArg, ...]}.
encode_query_response
Encode a query response: {"columns": [...], "rows": [[...], ...]}.
encode_subscribe_request
Encode a Subscribe request: {"tx_key": TxKey|nil, "query": str, "args": [QueryArg, ...]}.
encode_subscription_frame
Encode one subscription frame as a bare msgpack map.
encode_tx_key
Encode a bare TxKey body: {"tx_id": int, "system_time": Timestamp}. Used for both the DbOpened and submit/execute responses.
encode_tx_result_response
Encode a TxResult response.
entity_ref_from_value
query_arg_from_value
read_data_type
subscription_frame_from_value
Build a subscription frame from an already-parsed msgpack value (used by the streaming decoder).
tx_op_from_value
write_data_type
write_entity_ref
write_query_arg
write_tx_op