Skip to content

Commit 9513155

Browse files
authored
fix(engine/postgresql): jsonb_build_object (#1211)
Update the function signature of jsonb_build_object and jsonb_build_array with variadic arguments.
1 parent d0dae8b commit 9513155

File tree

5 files changed

+166
-4
lines changed

5 files changed

+166
-4
lines changed

internal/endtoend/testdata/json_build/postgresql/pgx/go/query.sql.go

Lines changed: 60 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

internal/endtoend/testdata/json_build/postgresql/pgx/query.sql

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,19 @@ SELECT
1313
json_build_array(1, 2),
1414
json_build_array(1, 2, 'foo'),
1515
json_build_array(1, 2, 'foo', 4);
16+
17+
-- name: SelectJSONBBuildObject :one
18+
SELECT
19+
jsonb_build_object(),
20+
jsonb_build_object('foo'),
21+
jsonb_build_object('foo', 1),
22+
jsonb_build_object('foo', 1, 2),
23+
jsonb_build_object('foo', 1, 2, 'bar');
24+
25+
-- name: SelectJSONBBuildArray :one
26+
SELECT
27+
jsonb_build_array(),
28+
jsonb_build_array(1),
29+
jsonb_build_array(1, 2),
30+
jsonb_build_array(1, 2, 'foo'),
31+
jsonb_build_array(1, 2, 'foo', 4);

internal/endtoend/testdata/json_build/postgresql/stdlib/go/query.sql.go

Lines changed: 60 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

internal/endtoend/testdata/json_build/postgresql/stdlib/query.sql

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,19 @@ SELECT
1313
json_build_array(1, 2),
1414
json_build_array(1, 2, 'foo'),
1515
json_build_array(1, 2, 'foo', 4);
16+
17+
-- name: SelectJSONBBuildObject :one
18+
SELECT
19+
jsonb_build_object(),
20+
jsonb_build_object('foo'),
21+
jsonb_build_object('foo', 1),
22+
jsonb_build_object('foo', 1, 2),
23+
jsonb_build_object('foo', 1, 2, 'bar');
24+
25+
-- name: SelectJSONBBuildArray :one
26+
SELECT
27+
jsonb_build_array(),
28+
jsonb_build_array(1),
29+
jsonb_build_array(1, 2),
30+
jsonb_build_array(1, 2, 'foo'),
31+
jsonb_build_array(1, 2, 'foo', 4);

internal/engine/postgresql/pg_catalog.go

Lines changed: 14 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)