Expand description
v4.14 minimal JSON parser for the -> / ->> operators.
Hand-rolled, no external dep — same policy as the rest of the
engine. Supports the JSON grammar from RFC 8259: objects,
arrays, strings (with \" / \\ / \/ / \b / \f / \n
/ \r / \t / \uXXXX escapes), numbers, true / false /
null. The parser returns a tree we walk by key (object) or
integer index (array); accesses that miss return Value::Null
per PG semantics.
path_get(doc, key, as_text) is the public entry. When
as_text is true (->> operator), JSON strings unwrap to
raw text and other scalars render as their canonical text;
when false (->), the result is wrapped back into a Json
value (the inner subtree rendered to its canonical JSON
string form).
Enums§
Functions§
- contains
- v6.4.5 — PG
json @> sub_jsoncontainment. Returns BOOL.lhs @> rhsis true when every member ofrhsis structurally contained inlhs: - parse
- path_
get - PG
json -> key/json ->> key.lhsmust be JSON or TEXT containing JSON.rhsis either a TEXT key (object access) or an INT index (array access).as_text=truefor->>(returnsValue::Text);falsefor->(returnsValue::Json). - path_
walk - v6.4.5 — PG
json #> path_text/json #>> path_text. The right-hand side is a PG text-array literal'{a,0,b}'whose elements are walked left-to-right; each element is either an object key or (when it parses as a non-negative integer) an array index. Missing or non-existent steps returnValue::Null.