Commit
- Loading branch information
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
CREATE TYPE ip_protocol AS enum('tcp', 'ip', 'icmp'); | ||
|
||
CREATE TABLE bar_old (id_old serial not null, ip_old ip_protocol NOT NULL); | ||
|
||
-- name: ListFoo :many | ||
SELECT id_old as foo_old, id_old as baz_old | ||
FROM bar_old | ||
WHERE ip_old = $1 AND id_old = $2; | ||
|
||
-- name: ListBar :many | ||
SELECT * FROM bar_old; | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
{ | ||
"version": "2", | ||
"sql": [ | ||
{ | ||
"schema": "query.sql", | ||
"queries": "query.sql", | ||
"engine": "postgresql", | ||
"gen": { | ||
"go": { | ||
"sql_package": "pgx/v4", | ||
"package": "querytest", | ||
"out": "go", | ||
"rename": { | ||
"id_old": "IDNew", | ||
"bar_old": "BarNew", | ||
"foo_old": "FooNew", | ||
"ip_protocol": "IPProtocol", | ||
"ip_protocol_tcp": "IPProtocolTCP" | ||
} | ||
} | ||
} | ||
} | ||
] | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
CREATE TYPE ip_protocol AS enum('tcp', 'ip', 'icmp'); | ||
|
||
CREATE TABLE bar_old (id_old serial not null, ip_old ip_protocol NOT NULL); | ||
|
||
-- name: ListFoo :many | ||
SELECT id_old as foo_old, id_old as baz_old | ||
FROM bar_old | ||
WHERE ip_old = $1 AND id_old = $2; | ||
|
||
-- name: ListBar :many | ||
SELECT * FROM bar_old; | ||
|