Interface QOM.JSONBConcat

All Superinterfaces:
Field<JSONB>, FieldOrConstraint, FieldOrRow, FieldOrRowOrSelect, GroupField, Named, OrderField<JSONB>, QueryPart, SelectField<JSONB>, SelectFieldOrAsterisk, Serializable, TableElement, Typed<JSONB>
Enclosing class:
QOM

public static interface QOM.JSONBConcat extends Field<JSONB>
The JSONB CONCAT function.

Concatenate two JSONB documents.

This works like PostgreSQL's JSONB || JSONB operator:

  • Two arrays are concatenated into a single array.
  • Two objects are merged into a single object. If both objects contain the same key, the second object's value is retained.
  • In all other cases, non-array values are wrapped in an array, and the resulting arrays are concatenated.
Dialects without native support for object merging may emulate it using JSON_MERGE_PATCH (RFC 7396), which merges nested objects recursively and removes keys whose value is null in the second object.
Author:
Lukas Eder