Skip to main content

Module values

Module values 

Source
Expand description

Value conversions at the client’s edges: driver JSON ({"$bytes": hex} convention) ↔ the §2.4 row-codec values ↔ SQLite storage, plus the §11.2 canonical scope JSON (contractual across implementations).

Structs§

EncryptionConfig
§5.11 client-side encryption keys (keyId → 32-byte key) plus optional key selection. Empty ⇒ E2EE off. key_id_for defaults to per-table (keyId = table). Always present on the client; the crypto is compiled only under the e2ee feature.

Functions§

bytes_to_hex
canonical_scope_json
§11.2 canonical JSON of a scope map: keys sorted by code-unit, value lists sorted and deduplicated, no insignificant whitespace.
column_value_to_json
Row-codec value → driver JSON value.
decode_row_bytes
Decode one row-codec payload; trailing bytes are a decode error. §5.11: encrypted columns are decrypted here — the apply seam — back to their declared-type plaintext value for the local mirror.
decrypt_segment_row
§5.11: decrypt the encrypted columns of an already-decoded segment row (rows segments decode via their own column table, so decryption is a post-decode pass over the positional values).
encode_row_json
Encode one full row (driver JSON values keyed by column name) with the generated row codec (§2.4, §6.1). §5.11: encrypted columns are encrypted here — the encode-at-send seam — before the codec serializes them as ciphertext-envelope bytes using wire_columns.
hex_to_bytes
json_to_column_value
Driver JSON value → row-codec value for one column. null/absent maps to NULL; bytes travel as {"$bytes": "<hex>"}.
json_to_scope_map
Driver JSON object → scope map, preserving key order.
render_row_id
Render a primary-key value as the wire rowId string.
render_row_id_json
Driver JSON value → wire rowId string (for optimistic upserts).
scope_map_to_json
Scope map as a driver JSON object (variable → list of values, §3.2).
sort_scope_map
Sort scope-map keys into ascending code-unit order (the canonical map encoding of the Conventions section).