Function jsonb_object_kv

Source
fn jsonb_object_kv(keys: ListRef<'_>, values: ListRef<'_>) -> Result<JsonbVal>
Expand description

This form of jsonb_object takes keys and values pairwise from separate text arrays. Otherwise it is identical to the one-argument form.

ยงExamples

query T
select jsonb_object('{a,b}', '{1,2}');
----
{"a": "1", "b": "2"}

query error mismatched array dimensions
select jsonb_object('{a,b}', '{1,2,3}');

# FIXME: `null` should be parsed as a null value instead of a "null" string.
# query error null value not allowed for object key
# select jsonb_object('{a,null}', '{1,2}');