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§
- Encryption
Config - §5.11 client-side encryption keys (
keyId → 32-byte key) plus optional key selection. Empty ⇒ E2EE off.key_id_fordefaults to per-table (keyId = table). Always present on the client; the crypto is compiled only under thee2eefeature.
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
bytesusingwire_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
rowIdstring. - render_
row_ id_ json - Driver JSON value → wire
rowIdstring (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
mapencoding of the Conventions section).