Skip to content

fix(copyfrom): Fix imports when non-copyfrom queries needed imports that copyfrom queries didn't #1386

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

Merged
merged 1 commit into from
Jan 22, 2022

Conversation

Jille
Copy link
Contributor

@Jille Jille commented Jan 21, 2022

The attached test case is broken without the fix and passes with the fix.

…hat copyfrom queries didn't

The attached test case is broken without the fix and passes with the
fix.
@kyleconroy kyleconroy merged commit 2c25c42 into sqlc-dev:main Jan 22, 2022
positiveblue added a commit to positiveblue/sqlc that referenced this pull request May 17, 2022
Depending on the commands used in your `query.sql` the `copyfrom.go`
may end up with unused packge imports.

There is a patch for this problem that was merged in the sqlc-dev#1386 PR.
However, it looks like some edge cases were left out of the fix.

This commit ensures that `buildImports` only has `copyfrom` queries
when called from `copyfromImports`.
kyleconroy pushed a commit that referenced this pull request May 22, 2022
Depending on the commands used in your `query.sql` the `copyfrom.go`
may end up with unused packge imports.

There is a patch for this problem that was merged in the #1386 PR.
However, it looks like some edge cases were left out of the fix.

This commit ensures that `buildImports` only has `copyfrom` queries
when called from `copyfromImports`.
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.

2 participants