Closed
Description
Version
1.14.0
What happened?
As part of a project, we are exposing a configuration parameter to allow users to configure their timezone. This allows us to send notifications at the correct times, is useful for reporting etc. Since we are using postgres for all the timezone calculations, we want to populate the list of available options to the users directly from pg_timezone_names
. However, sqlc does not recognized that.
I have narrowed down the problem to sqlc-pg-gen
not automatically populating pre-existing tables from pg_tables
and pg_views
. And will try to follow up with an actual PR to address this, but wanted to write up the issue first.
Relevant log output
# package queries
queries/timezone.sql:1:1: relation "pg_timezone_names" does not exist
make: *** [gen] Error 1
Database schema
-- no schema necessary
SQL queries
-- name: GetTimezones :many
select * from pg_catalog.pg_timezone_names;
Configuration
{
"version": "1",
"packages": [
{
"path": "db",
"engine": "postgresql",
"schema": "query.sql",
"queries": "query.sql"
}
]
}
Playground URL
https://play.sqlc.dev/p/9c6742a1a8575147dc27d496361747f0811296c775c7b43d04b3ef0250d3df3f
What operating system are you using?
macOS
What database engines are you using?
PostgreSQL
What type of code are you generating?
Go