-
Notifications
You must be signed in to change notification settings - Fork 1k
pg-gen: implement information_schema shema #1815
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
d9aa81e
be3f0b5
fb6482b
d349501
b8f96a6
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
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.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| -- name: GetTimezones :many | ||
| SELECT * from pg_catalog.pg_timezone_names; | ||
|
|
||
| -- name: GetTables :many | ||
| SELECT table_name::text from information_schema.tables; | ||
|
|
||
| -- name: GetColumns :many | ||
| SELECT table_name::text, column_name::text from information_schema.columns; | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| { | ||
| "version": "2", | ||
| "sql": [ | ||
| { | ||
| "engine": "postgresql", | ||
| "schema": "query.sql", | ||
| "queries": "query.sql", | ||
| "gen": { | ||
| "go": { | ||
| "sql_package": "pgx/v4", | ||
| "package": "querytest", | ||
| "out": "go_pgx" | ||
| } | ||
| } | ||
| }, | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @kyleconroy I found that undoing the nesting (and using multiple |
||
| { | ||
| "engine": "postgresql", | ||
| "schema": "query.sql", | ||
| "queries": "query.sql", | ||
| "gen": { | ||
| "go": { | ||
| "package": "querytest", | ||
| "out": "go_stdlib" | ||
| } | ||
| } | ||
| } | ||
| ] | ||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had to cast these to
::textsince I think the information_schema uses a database type that is not currently recognized by sqlc (it usedinterface{}). It might be a simple fix to change that.