Skip to content
# Class: PostgresJsonQueryBuilder

Defined in: packages/core/src/transformers/PostgresJsonQueryBuilder.ts:38

PostgreSQL JSON query builder that transforms SimpleSelectQuery into queries that return JSON arrays or single JSON objects using PostgreSQL JSON functions.

Constructors

Constructor

new PostgresJsonQueryBuilder(): PostgresJsonQueryBuilder

Defined in: packages/core/src/transformers/PostgresJsonQueryBuilder.ts:43

Returns

PostgresJsonQueryBuilder

Methods

buildJsonQuery()

Call Signature

buildJsonQuery(originalQuery, mapping, options?): SimpleSelectQuery

Defined in: packages/core/src/transformers/PostgresJsonQueryBuilder.ts:124

Build JSON query from original query and mapping configuration.

Parameters
originalQuery

SelectQuery

Original query to transform (can be any SelectQuery type)

mapping

JsonMapping

JSON mapping configuration

options?

QueryBuildOptions

Returns

SimpleSelectQuery

Transformed query with JSON aggregation

Call Signature

buildJsonQuery(originalQuery, mapping, options?): SimpleSelectQuery

Defined in: packages/core/src/transformers/PostgresJsonQueryBuilder.ts:125

Build JSON query from original query and mapping configuration.

Parameters
originalQuery

SimpleSelectQuery

Original query to transform (can be any SelectQuery type)

mapping

JsonMapping

JSON mapping configuration

options?

QueryBuildOptions

Returns

SimpleSelectQuery

Transformed query with JSON aggregation


buildJson()

buildJson(originalQuery, mapping): SimpleSelectQuery

Defined in: packages/core/src/transformers/PostgresJsonQueryBuilder.ts:151

Build JSON query from original query and mapping configuration.

Parameters

originalQuery

SimpleSelectQuery

Original query to transform

mapping

JsonMapping

JSON mapping configuration

Returns

SimpleSelectQuery

Transformed query with JSON aggregation

Deprecated

Use buildJsonQuery instead. This method will be removed in a future version.

Released under the MIT License.