-
Notifications
You must be signed in to change notification settings - Fork 804
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(compiler): Search SELECT and UPDATE the same way (#2841)
* fix(compiler): Search SELECT and UPDATE the same way * Update sqlc.yaml
- Loading branch information
1 parent
f09d96f
commit 27e47b9
Showing
8 changed files
with
114 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
https://github.com/sqlc-dev/sqlc/issues/1100 |
32 changes: 32 additions & 0 deletions
32
internal/endtoend/testdata/join_update/postgresql/pgx/go/db.go
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
24 changes: 24 additions & 0 deletions
24
internal/endtoend/testdata/join_update/postgresql/pgx/go/models.go
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
23 changes: 23 additions & 0 deletions
23
internal/endtoend/testdata/join_update/postgresql/pgx/go/query.sql.go
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
6 changes: 6 additions & 0 deletions
6
internal/endtoend/testdata/join_update/postgresql/pgx/query.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
-- name: Percentile :exec | ||
UPDATE group_calc_totals gct | ||
SET npn = nem.npn | ||
FROM producer_group_attribute ga | ||
JOIN npn_external_map nem ON ga.npn_external_map_id = nem.id | ||
WHERE gct.group_id = ga.group_id; |
14 changes: 14 additions & 0 deletions
14
internal/endtoend/testdata/join_update/postgresql/pgx/schema.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
CREATE TABLE group_calc_totals ( | ||
npn text, | ||
group_id text | ||
); | ||
|
||
CREATE TABLE producer_group_attribute ( | ||
npn_external_map_id text, | ||
group_id text | ||
); | ||
|
||
CREATE TABLE npn_external_map ( | ||
id text, | ||
npn text | ||
); |
10 changes: 10 additions & 0 deletions
10
internal/endtoend/testdata/join_update/postgresql/pgx/sqlc.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
version: "2" | ||
sql: | ||
- engine: "postgresql" | ||
schema: "schema.sql" | ||
queries: "query.sql" | ||
gen: | ||
go: | ||
package: "querytest" | ||
out: "go" | ||
sql_package: "pgx/v5" |