Expand description
MessagePack-based binary encoding for CypherValue (uni_common::Value).
§Design
All property values are stored as self-describing binary blobs in Arrow
LargeBinary columns. Each blob has the format:
[tag_byte: u8][msgpack_payload: bytes]The tag byte provides O(1) type identification without deserialization. MessagePack preserves int/float distinction natively (unlike JSON).
§Tag Constants
| Tag | Type | Payload |
|---|---|---|
| 0 | Null | empty |
| 1 | Bool | msgpack bool |
| 2 | Int | msgpack i64 |
| 3 | Float | msgpack f64 |
| 4 | String | msgpack string |
| 5 | List | msgpack array of recursively-encoded blobs |
| 6 | Map | msgpack map of string → recursively-encoded blobs |
| 7 | Bytes | msgpack binary |
| 8 | Node | msgpack {vid, label, props} |
| 9 | Edge | msgpack {eid, type, src, dst, props} |
| 10 | Path | msgpack {nodes, rels} |
| 11 | Date | msgpack i32 (days since epoch) |
| 12 | Time | msgpack i64 (nanoseconds since midnight) |
| 13 | DateTime | msgpack i64 (nanoseconds since epoch) |
| 14 | Duration | msgpack {months, days, nanos} |
| 15 | Point | msgpack {srid, coords} |
| 16 | Vector | msgpack array of f32 |
Nested values (List elements, Map values, Node/Edge properties) are
recursively encoded as [tag][payload] blobs.
Constants§
- TAG_
BOOL - TAG_
BYTES - TAG_
DATE - TAG_
DATETIME - TAG_
DURATION - TAG_
EDGE - TAG_
FLOAT - TAG_INT
- TAG_
LIST - TAG_
LOCALDATETIME - TAG_
LOCALTIME - TAG_MAP
- TAG_
NODE - TAG_
NULL - TAG_
PATH - TAG_
STRING - TAG_
TIME - TAG_
VECTOR
Functions§
- decode
- Decode tagged MessagePack bytes to a Value.
- decode_
bool - Decode a bool directly without constructing a Value.
- decode_
float - Decode a float directly without constructing a Value.
- decode_
int - Decode an int directly without constructing a Value.
- decode_
string - Decode a string directly without constructing a Value.
- encode
- Encode a Value to tagged MessagePack bytes.
- encode_
bool - Encode a bool directly without constructing a Value.
- encode_
float - Encode a float directly without constructing a Value.
- encode_
int - Encode an int directly without constructing a Value.
- encode_
null - Encode null directly.
- encode_
string - Encode a string directly without constructing a Value.
- extract_
map_ entry_ raw - Extract a map entry as raw bytes without decoding the entire map.
- is_null
- Fast null check.
- peek_
tag - Peek at the tag byte without deserializing.