Skip to content

Commit fffa3be

Browse files
tests: added json_build pgx test
1 parent 1cf163d commit fffa3be

File tree

10 files changed

+132
-0
lines changed

10 files changed

+132
-0
lines changed

internal/endtoend/testdata/json_build/postgresql/pgx/go/db.go

Lines changed: 30 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/go/query.sql.go

Lines changed: 69 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"version": "1",
3+
"packages": [
4+
{
5+
"path": "go",
6+
"engine": "postgresql",
7+
"driver": "pgx/v4",
8+
"name": "querytest",
9+
"schema": "query.sql",
10+
"queries": "query.sql"
11+
}
12+
]
13+
}

internal/endtoend/testdata/json_build/postgresql/stdlib/go/models.go

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
-- name: SelectJSONBuildObject :one
2+
SELECT
3+
json_build_object(),
4+
json_build_object('foo'),
5+
json_build_object('foo', 1),
6+
json_build_object('foo', 1, 2),
7+
json_build_object('foo', 1, 2, 'bar');
8+
9+
-- name: SelectJSONBuildArray :one
10+
SELECT
11+
json_build_array(),
12+
json_build_array(1),
13+
json_build_array(1, 2),
14+
json_build_array(1, 2, 'foo'),
15+
json_build_array(1, 2, 'foo', 4);

0 commit comments

Comments
 (0)