We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
1.21.0
This query:
-- name: GetTables :many SELECT * FROM pg_catalog.pg_tables WHERE schemaname != 'pg_catalog' AND schemaname != 'information_schema';
generates the following schema:
type GetTablesRow struct { Schemaname interface{} Tablename interface{} Tableowner interface{} Tablespace interface{} Hasindexes pgtype.Bool Hasrules pgtype.Bool Hastriggers pgtype.Bool Rowsecurity pgtype.Bool }
The type for Schemaname, Tablename, Tableowner should be string and for Tablespace a string pointer instead of the interface{} I believe.
Schemaname, Tablename, Tableowner
Tablespace
interface{}
No response
macOS
PostgreSQL
Go
The text was updated successfully, but these errors were encountered:
fix(codegen/golang): support name type
a6a8db1
close sqlc-dev#2714
fix(codegen/golang): support name type (#2715)
79c58b7
close #2714
I just tested this and was able to confirm that it works. New generated output is:
const getTables = `-- name: GetTables :many SELECT schemaname, tablename, tableowner, tablespace, hasindexes, hasrules, hastriggers, rowsecurity FROM pg_catalog.pg_tables WHERE schemaname != 'pg_catalog' AND schemaname != 'information_schema' ` type GetTablesRow struct { Schemaname pgtype.Text Tablename pgtype.Text Tableowner pgtype.Text Tablespace pgtype.Text Hasindexes pgtype.Bool Hasrules pgtype.Bool Hastriggers pgtype.Bool Rowsecurity pgtype.Bool }
Thank you both for the super quick turnaround @andrewmbenton and @orisano
Sorry, something went wrong.
Successfully merging a pull request may close this issue.
Version
1.21.0
What happened?
This query:
generates the following schema:
The type for
Schemaname, Tablename, Tableowner
should be string and forTablespace
a string pointer instead of theinterface{}
I believe.Relevant log output
No response
Database schema
No response
SQL queries
Configuration
No response
Playground URL
No response
What operating system are you using?
macOS
What database engines are you using?
PostgreSQL
What type of code are you generating?
Go
The text was updated successfully, but these errors were encountered: