Skip to content
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

pg-gen: implement information_schema shema #1815

Merged
merged 5 commits into from
Aug 23, 2022

Conversation

skabbes
Copy link
Contributor

@skabbes skabbes commented Aug 23, 2022

Fixes: #1800

Was relatively straightforward after #1811

I recommend reviewing commit by commit - since I separated out the "auto-generated files commits" from the rest of the changes.

"out": "go_pgx"
}
}
},
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kyleconroy I found that undoing the nesting (and using multiple sql array elements, made these things a lot easier to test.

SELECT * from pg_catalog.pg_timezone_names;

-- name: GetTables :many
SELECT table_name::text from information_schema.tables;
Copy link
Contributor Author

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 ::text since I think the information_schema uses a database type that is not currently recognized by sqlc (it used interface{}). It might be a simple fix to change that.

@kyleconroy kyleconroy merged commit eea73f6 into sqlc-dev:main Aug 23, 2022
@skabbes skabbes deleted the information_schema branch August 23, 2022 13:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add support for queries against information_schema tables
2 participants