Open dhermes opened 1 year ago
I want to be clear, we can workaround it by just covering both types of resolved column type name
overrides:
go:
overrides:
- go_type: string
db_type: app.html5_email_address
nullable: false
- go_type: database/sql.NullString
db_type: app.html5_email_address
nullable: true
# --------------------------------------------
- go_type: string
db_type: html5_email_address
nullable: false
- go_type: database/sql.NullString
db_type: html5_email_address
nullable: true
# --------------------------------------------
- go_type: github.com/shopspring/decimal.Decimal
db_type: pg_catalog.numeric
nullable: false
- go_type: github.com/shopspring/decimal.NullDecimal
db_type: pg_catalog.numeric
nullable: true
# --------------------------------------------
- go_type: github.com/shopspring/decimal.Decimal
db_type: numeric
nullable: false
- go_type: github.com/shopspring/decimal.NullDecimal
db_type: numeric
nullable: true
I'm just filing the issue to let you know that there is a "drift" in the actually resolved name and it may represent a larger issue.
Version
1.23.0
What happened?
PostgreSQL column types resolve to different names in "database" mode vs. "static analysis" mode (i.e. the "old way"). Two examples encountered in our production codebase (a long-time user of
sqlc
):html5_email_address
app.html5_email_address
numeric
pg_catalog.numeric
In both cases the schema is absent in "database" mode.
Relevant log output
No response
Database schema
SQL queries
Configuration
No response
Playground URL
https://play.sqlc.dev/p/bf27993cf03969b4f19f4f1d955220188538bb833a447489e2c9825c798f4cbe
What operating system are you using?
Linux, macOS
What database engines are you using?
PostgreSQL
What type of code are you generating?
Go