Skip to content

Commit cca78ef

Browse files
authored
testdata: Make sure all Go examples build (#480)
* testdata: Make sure all Go examples build * Fix workflow file
1 parent 3d3630a commit cca78ef

File tree

13 files changed

+24
-16
lines changed

13 files changed

+24
-16
lines changed

.github/workflows/ci.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@ jobs:
2626
with:
2727
go-version: '1.13'
2828

29+
- run: go build ./...
30+
working-directory: internal/endtoend/testdata
31+
2932
- name: Test sqlc
3033
run: go test --tags=examples,exp -v ./...
3134
env:

go.mod

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ require (
77
github.com/davecgh/go-spew v1.1.1
88
github.com/google/go-cmp v0.3.0
99
github.com/jinzhu/inflection v1.0.0
10+
github.com/kyleconroy/sqlc-testdata v0.0.0-20200512000015-15313bc43553
1011
github.com/lfittl/pg_query_go v1.0.0
1112
github.com/lib/pq v1.4.0
1213
github.com/pingcap/parser v0.0.0-20200218113622-517beb2e39c2

go.sum

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -264,6 +264,10 @@ github.com/kr/pty v1.1.8/go.mod h1:O1sed60cT9XZ5uDucP5qwvh+TE3NnUj51EiZO/lmSfw=
264264
github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE=
265265
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
266266
github.com/krishicks/yaml-patch v0.0.10/go.mod h1:Sm5TchwZS6sm7RJoyg87tzxm2ZcKzdRE4Q7TjNhPrME=
267+
github.com/kyleconroy/sqlc-testdata v0.0.0-20200511235212-18465b4db129 h1:rcRuVPC6SZbmt0P/uJwqWnR5uLSkG7Qn2XPvcCWuZUw=
268+
github.com/kyleconroy/sqlc-testdata v0.0.0-20200511235212-18465b4db129/go.mod h1:F2aHHOnBI1Big/J6ffYQnyyUXxcZ1vI9IXPaA0noK8c=
269+
github.com/kyleconroy/sqlc-testdata v0.0.0-20200512000015-15313bc43553 h1:IlnX6Ga5wEbn5Ejey9S6GTSzoAJuCnmxYjYZa6nUbsE=
270+
github.com/kyleconroy/sqlc-testdata v0.0.0-20200512000015-15313bc43553/go.mod h1:F2aHHOnBI1Big/J6ffYQnyyUXxcZ1vI9IXPaA0noK8c=
267271
github.com/lfittl/pg_query_go v1.0.0 h1:rcHZK5DBEUoxtO6dACP+UVCHKtA1ZsELBW0rSjOXMAE=
268272
github.com/lfittl/pg_query_go v1.0.0/go.mod h1:jcikG62RKf+NIWmbLzjjk73m4x6um2pKf3h+TJyINms=
269273
github.com/lib/pq v1.2.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo=

internal/endtoend/testdata/limit/go/query.sql.go

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
CREATE TABLE foo (bar bool not null);
22

3-
-- name: Limit :many
3+
-- name: LimitMe :many
44
SELECT bar FROM foo LIMIT $1;

internal/endtoend/testdata/limit/sqlc.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
"version": "1",
33
"packages": [{
44
"path": "go",
5-
"name": "querytest",
6-
"schema": "query.sql",
7-
"queries": "query.sql"
5+
"name": "querytest",
6+
"schema": "query.sql",
7+
"queries": "query.sql"
88
}]
99
}

internal/endtoend/testdata/mysql_overrides/go/models.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

internal/endtoend/testdata/mysql_overrides/go/query.sql.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

internal/endtoend/testdata/mysql_overrides/sqlc.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,16 @@
88
"queries": "query.sql",
99
"engine": "mysql",
1010
"overrides": [{
11-
"go_type": "example.com/mysql.ID",
11+
"go_type": "github.com/kyleconroy/sqlc-testdata/mysql.ID",
1212
"column": "users.id"
1313
}, {
14-
"go_type": "example.com/mysql.ID",
14+
"go_type": "github.com/kyleconroy/sqlc-testdata/mysql.ID",
1515
"column": "orders.id"
1616
}]
1717
}
1818
],
1919
"overrides": [{
20-
"go_type": "example.com/mysql.Timestamp",
20+
"go_type": "github.com/kyleconroy/sqlc-testdata/mysql.Timestamp",
2121
"db_type": "timestamp"
2222
}]
2323
}

internal/endtoend/testdata/overrides/go/models.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)