On this page
Supported first-class data model alongside relational and temporal. No separate document store. Storage: json (text) vs jsonb (canonical bytes). Engine: crates/json + crates/types/src/jsonb.rs.
-> ->> #> #>> #- @> <@ ? ?| ?& @? @@, subscripts, paths
FunctionsEvery JSON function with signature + example
JSON_TABLEShred documents into rows
Mental model#
flowchart LR
Col["JSONB column"] --> Op["operators: navigate + predicate"]
Op --> Fn["functions: build + transform + aggregate"]
Fn --> Tbl["JSON_TABLE: rows"]
Tbl --> Join["JOIN / GROUP BY / window"]Diagram source · mermaidcopy included
flowchart LR
Col["JSONB column"] --> Op["operators: navigate + predicate"]
Op --> Fn["functions: build + transform + aggregate"]
Fn --> Tbl["JSON_TABLE: rows"]
Tbl --> Join["JOIN / GROUP BY / window"]JSON values flow through ordinary SQL: filter (@>), project (->>), aggregate (json_agg), join on extracted keys, window over time. Missing field → SQL NULL (see NULL).
Quick taste#
CREATE TABLE events (id BIGINT PRIMARY KEY, payload JSONB);
INSERT INTO events VALUES (1, '{"user":{"name":"ada"},"ok":true}');
SELECT payload->'user'->>'name' AS name FROM events WHERE payload @> '{"ok": true}';
SELECT json_agg(payload ORDER BY id) FROM events;For future VECTOR / GRAPH planners#
Vector embeddings and graph traversals are not in v0.1.0. JSON arrays can hold embedding-like data today ([0.1, 0.2] + jsonb_array_elements), but there are no distance operators or indexes. See Future data models for the explicit firewall.
Next: Operators → Functions → JSON_TABLE → Query JSON guide