Skip to content
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

sqlc doesn't handle oid types correctly with pgx/v4 #2667

Closed
andrewmbenton opened this issue Aug 28, 2023 · 0 comments · Fixed by #2668
Closed

sqlc doesn't handle oid types correctly with pgx/v4 #2667

andrewmbenton opened this issue Aug 28, 2023 · 0 comments · Fixed by #2668
Labels
bug Something isn't working triage New issues that hasn't been reviewed

Comments

@andrewmbenton
Copy link
Collaborator

andrewmbenton commented Aug 28, 2023

Version

1.20.0

What happened?

From this discord thread: https://discord.com/channels/946447283321438248/1145749639916683305

It looks like sqlc-generated Go code tries to use a non-existent pgtype.Uint32 for cid and oid database types when configured for pgx/v4 which imports from github.com/jackc/pgtype (see https://github.com/sqlc-dev/sqlc/blob/v1.20.0/internal/codegen/golang/postgresql_type.go#L481).

Note that with pgx/v5 configured, sqlc imports from github.com/jackc/pgx/v5/pgtype which does appear to have the pgtype.Uint32 type.

See the playground link for an example.

Relevant log output

No response

Database schema

No response

SQL queries

No response

Configuration

No response

Playground URL

https://play.sqlc.dev/p/e8c728dddddc0248aae7194bc4d0fac902cc43ae72c2d726a2d7f10c683f82e2

What operating system are you using?

No response

What database engines are you using?

PostgreSQL

What type of code are you generating?

Go

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working triage New issues that hasn't been reviewed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant