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

To check if batch is closed if you need to return a pointer to the type the wrong code is generated #1959

Closed
flymedllva opened this issue Nov 19, 2022 · 4 comments · Fixed by #1960

Comments

@flymedllva
Copy link
Contributor

flymedllva commented Nov 19, 2022

Version

v1.16.0 or 3623ec8, version v1.15.0 has the correct behavior, since there is no batch closeness check

What happened?

To check if batch is closed if you need to return a pointer to the type the wrong code is generated

Screenshot 2022-11-19 at 17 39 42

SQL queries

:batchone

Configuration

version: "2"
engine: "postgresql"
sql_package: "pgx/v4"
emit_db_tags: true
emit_result_struct_pointers: true

What operating system are you using?

macOS

What database engines are you using?

PostgreSQL

What type of code are you generating?

Go

@flymedllva flymedllva added bug Something isn't working triage New issues that hasn't been reviewed labels Nov 19, 2022
flymedllva added a commit to flymedllva/sqlc that referenced this issue Nov 19, 2022
flymedllva added a commit to flymedllva/sqlc that referenced this issue Nov 19, 2022
@JordanP
Copy link
Contributor

JordanP commented Nov 21, 2022

Nothing really wrong in the original PR, it's just that the emit_result_struct_pointers feature flag did not exist when the PGXv5 support was originally submitted.

@JordanP
Copy link
Contributor

JordanP commented Nov 21, 2022

It certainly is a regression though,it probably means we moved "old" code to a new place.

@flymedllva
Copy link
Contributor Author

This flag was also for v4. Generally, with this flag there is an error in codogeneration

@thesiti92
Copy link

would be great to merge this :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants