Feature Request: Add PostgreSQL JSONB helpers (jsonbArrayFrom, jsonbObjectFrom, jsonbBuildObject)
Currently kysely/helpers/postgres provides jsonArrayFrom, jsonObjectFrom and jsonBuildObject which compile to PostgreSQL json_agg(), to_json() and json_build_object().
In Postgres jsonb is preferred over json for binary storage, GIN indexing and containment operators. When using current helpers the returned query fragment casts to standard json, requiring manual ::jsonb casting when combined with other jsonb expressions.
Adding jsonbArrayFrom, jsonbObjectFrom and jsonbBuildObject with current json* helpers provides native JSONB support without breaking existing code.
Feature Request: Add PostgreSQL
JSONBhelpers (jsonbArrayFrom,jsonbObjectFrom,jsonbBuildObject)Currently
kysely/helpers/postgresprovidesjsonArrayFrom,jsonObjectFromandjsonBuildObjectwhich compile to PostgreSQLjson_agg(),to_json()andjson_build_object().In Postgres
jsonbis preferred overjsonfor binary storage, GIN indexing and containment operators. When using current helpers the returned query fragment casts to standardjson, requiring manual::jsonbcasting when combined with otherjsonbexpressions.Adding
jsonbArrayFrom,jsonbObjectFromandjsonbBuildObjectwith currentjson*helpers provides nativeJSONBsupport without breaking existing code.