Skip to content

Commit ee19373

Browse files
committed
test: Add case for #2386
1 parent fc10954 commit ee19373

8 files changed

Lines changed: 112 additions & 0 deletions

File tree

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
https://github.com/sqlc-dev/sqlc/issues/2386
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"contexts": ["managed-db"]
3+
}

‎internal/endtoend/testdata/func_return_table_columns/postgresql/pgx/go/db.go‎

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

‎internal/endtoend/testdata/func_return_table_columns/postgresql/pgx/go/models.go‎

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

‎internal/endtoend/testdata/func_return_table_columns/postgresql/pgx/go/query.sql.go‎

Lines changed: 41 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
-- name: TestFuncSelectBlog :many
2+
select id, name from test_select_blog($1);
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
create table blog (
2+
id serial primary key,
3+
name text not null
4+
);
5+
6+
create function test_select_blog(in p_id int)
7+
returns table (id int, name text) AS $$
8+
BEGIN RETURN QUERY
9+
select id, name from blog where id = p_id;
10+
END;
11+
$$ language plpgsql;
Lines changed: 10 additions & 0 deletions
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: "pgx/v5"

0 commit comments

Comments
 (0)