#1969·kysely

Feature: Add PostgreSQL `JSONB` helpers (`jsonbArrayFrom`, `jsonbObjectFrom`, `jsonbBuildObject`)

Author: HITESH-S-PCreated Aug 5, 2026Updated Aug 5, 2026

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.