-
Notifications
You must be signed in to change notification settings - Fork 885
Invalid UUID type is generated when db column is declared with REFERENCES #2738
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
Comments
The issue here is not related to the version: "2"
sql:
- engine: "postgresql"
schema: "/"
queries: "/"
gen:
go:
sql_package: "pgx/v5"
package: "db"
out: "./"
emit_json_tags: true
emit_pointers_for_null_types: true
json_tags_case_style: camel
query_parameter_limit: 5
overrides:
- db_type: "uuid"
go_type: "github.com/gofrs/uuid.UUID"
- db_type: "uuid"
go_type: "github.com/gofrs/uuid.UUID"
nullable: true We should document this better in https://docs.sqlc.dev/en/stable/reference/config.html#type-overriding |
I see. So it's a different bug, since I've requested "emit_pointers_for_null_types: true" and got "pgtype.UUID" instead of "*uuid.UUID" see: #2630 |
I have the same issue with version v1.25.0 https://play.sqlc.dev/p/c0783e2fdd1ba1dfeca0b396bb9f0cbe3ce79a22a552aecd7565bda94ff68cec
|
Uh oh!
There was an error while loading. Please reload this page.
Version
1.21.0
What happened?
sqlc with pgx/v5 and uuid type overriden by github.com/gofrs/uuid.UUID:
Structures and functions are generated with incorrect pgtype.UUID type for uuid columns annotated with REFERENCES keyword.
I expect the type to be uuid.UUID as requested:
Relevant log output
Database schema
SQL queries
Configuration
Playground URL
https://play.sqlc.dev/p/9e6006530d91b4c02abb280f1683215ee1927049124a21e616399489f4353d98
What operating system are you using?
macOS
What database engines are you using?
PostgreSQL
What type of code are you generating?
Go
The text was updated successfully, but these errors were encountered: