Skip to content

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

Description

@HITESH-S-P

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions