Skip to main content

json_ctor_object

Function json_ctor_object 

Source
pub fn json_ctor_object(
    args: &[(u32, Value)],
    jsonb: bool,
    absent_on_null: bool,
    unique: bool,
    session: &dyn Session,
) -> Result<Value>
Expand description

json_build_object_worker and jsonb_build_object_worker for JSON_OBJECT: an object of the keys and the values, one after the other.

A json value keeps each field in its order. A jsonb value keeps the last field of each key, and then ABSENT ON NULL removes each field with a JSON null value, as uniqueifyJsonbObject does. A key of a field that ABSENT ON NULL skips still counts for WITH UNIQUE KEYS.

ยงErrors

The error of a null key, of a key that is not a scalar, or of a key that is not unique.