Skip to content

Commit 7f28f17

Browse files
committed
Add incorrect test-case that showcases overrides not working with sqlc.slice
The new method should've taken a []mysql.ID instead
1 parent f086636 commit 7f28f17

File tree

4 files changed

+58
-5
lines changed

4 files changed

+58
-5
lines changed

internal/endtoend/testdata/sqlc_slice/mysql/go/models.go

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

internal/endtoend/testdata/sqlc_slice/mysql/go/query.sql.go

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

internal/endtoend/testdata/sqlc_slice/mysql/query.sql

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
CREATE TABLE foo (id int not null, name text not null, bar text null);
1+
CREATE TABLE foo (id int not null, name text not null, bar text null, mystr text not null);
22

33
/* name: FuncParamIdent :many */
44
SELECT name FROM foo
@@ -20,4 +20,8 @@ WHERE id IN (sqlc.slice(favourites));
2020

2121
/* name: FuncNullable :many */
2222
SELECT bar FROM foo
23-
WHERE id IN (sqlc.slice('favourites'));
23+
WHERE id IN (sqlc.slice('favourites'));
24+
25+
/* name: TypedMyStr :many */
26+
SELECT bar FROM foo
27+
WHERE mystr IN (sqlc.slice(mystr));

internal/endtoend/testdata/sqlc_slice/mysql/sqlc.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,11 @@
88
"schema": "query.sql",
99
"queries": "query.sql"
1010
}
11+
],
12+
"overrides": [
13+
{
14+
"column": "foo.mystr",
15+
"go_type": "github.com/kyleconroy/sqlc-testdata/mysql.ID"
16+
}
1117
]
1218
}

0 commit comments

Comments
 (0)