JSON in PLOMID — overview

Document + relational in one engine. Where JSON lives, how to think, where to go deep.

Version
Latest
v0.1.0 · latest 1 min read
On this page
  1. Mental model
  2. Quick taste
  3. For future VECTOR / GRAPH planners
✓

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.

Mental model#

diagram
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
mermaidsource
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#

sqlsource
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

Was this page helpful?