Skip to content

Commit 23fb248

Browse files
committed
test: Add a test case for #2639
1 parent 3ff79f2 commit 23fb248

File tree

8 files changed

+125
-0
lines changed

8 files changed

+125
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
https://github.com/sqlc-dev/sqlc/pull/2639
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"contexts": ["managed-db"]
3+
}

internal/endtoend/testdata/select_subquery/postgresql/stdlib/go/db.go

+31
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

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

+19
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

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

+53
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
-- name: Subquery :many
2+
SELECT
3+
a,
4+
name,
5+
(SELECT alias FROM bar WHERE bar.a=foo.a AND alias = $1 ORDER BY bar.a DESC limit 1) as alias
6+
FROM FOO WHERE a = $2;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
CREATE TABLE foo (a int not null, name text);
2+
CREATE TABLE bar (a int not null, alias text);
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
version: "2"
2+
sql:
3+
- engine: "postgresql"
4+
schema: "schema.sql"
5+
queries: "query.sql"
6+
gen:
7+
go:
8+
package: "querytest"
9+
out: "go"
10+
sql_package: "database/sql"

0 commit comments

Comments
 (0)