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

Fixes MySQL copyfrom generation with 1 arg stucts #3446

Merged
merged 4 commits into from
Jun 15, 2024

Conversation

terricain
Copy link
Contributor

@terricain terricain commented Jun 14, 2024

Fixes #3443

The copyfrom template generates syntactically incorrect Go when query_parameter_limit is set to 0.

There was a similar bug where by when query_parameter_limit was set to 4 but the number of copyfrom parameters was 2, the struct referenced was not being emitted.

@kyleconroy kyleconroy merged commit e623dc1 into sqlc-dev:main Jun 15, 2024
8 checks passed
@terricain terricain deleted the issue_3443_copyfrom branch June 15, 2024 16:03
lisitsky pushed a commit to lisitsky/sqlc that referenced this pull request Jun 21, 2024
* Updated MySQL copyfrom template to handle strucs with 1 argument

* Added copyfrom 1 arg struct testcase

* Fixed issue where copyfrom structs were not being emitted

* Added testcase to catch not emitting structs used with copyfrom
@ysmilda
Copy link

ysmilda commented Jul 24, 2024

Would it be possible to create a new release so we can make use of this fix?

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

Successfully merging this pull request may close these issues.

MySQL copyfrom with query_parameter_limit: 0 generates invalid go code
3 participants