Open marcusirgens opened 3 years ago
I just encountered the same issue, and "resolved" it for now by supplying the following override:
overrides:
- column: "table_name.column_name"
go_type: "database/sql.NullString"
It seems https://pkg.go.dev/github.com/jackc/pgtype@v1.12.0#Interval would also be appropriate here?
Version
1.10.0
What happened?
Generated code using the
interval
type in Postgres causesinvalid syntax
errors.I've created a sample application to test the behaviour (as I am not quite sure how to run tests with an actual database in this repository). I've essentially used the
internal/endtoend/testdata/interval/stdlib
configuration as is, and it fails to both insert and read from the table.The errors I receive are:
and
Full code to reproduce the issue is available at
github.com/marcusirgens/sqlc-interval-debug
.Relevant log output
Database schema
SQL queries
Configuration
Playground URL
https://play.sqlc.dev/p/db2d826c95be71b1f3cce981b8dfe5f55b23ed7b3a80ba60a1d80377512ee999
What operating system are you using?
macOS
What database engines are you using?
PostgreSQL
What type of code are you generating?
Go