-
Notifications
You must be signed in to change notification settings - Fork 909
Description
Version
1.18.0
What happened?
This is a small, avoidable issue, but figured it'd still be worth filling.
In our project we upgraded to pgx V5 but we're keeping the old types around to make diffing / migrating easier. To do this we overrided all the next pgx v5 types back to the v4 ones (per this: https://brandur.org/fragments/pgx-v5-sqlc-upgrade). This worked, but we noticed one small issue: sqlc will still import "github.com/jackc/pgx/v5/pgtype"
even if it's not used. If you specify the package name in the go_type
though it fixes things.
Probably best explained with two examples.
Buggy example, using simple "go_type": "github.com/jackc/pgtype.JSON",
override leading to duplicate pgtype
import:
https://play.sqlc.dev/p/a591a3804810387f6091e9956ad377c4a1296d3d542dd99ce3d24fc279b65ae8
Example with fix by fully specifying go_type
: https://play.sqlc.dev/p/f2fc490770943506e053b59c0839e29046b2843b2067fc4e034dbdb7e8031479
Relevant log output
No response
Database schema
No response
SQL queries
No response
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
Activity