feat(codegen): add support for build tags (#2012)#2807
Merged
kyleconroy merged 5 commits intosqlc-dev:mainfrom Oct 6, 2023
Merged
feat(codegen): add support for build tags (#2012)#2807kyleconroy merged 5 commits intosqlc-dev:mainfrom
kyleconroy merged 5 commits intosqlc-dev:mainfrom
Conversation
kyleconroy
requested changes
Oct 5, 2023
Collaborator
kyleconroy
left a comment
There was a problem hiding this comment.
Thanks! Only one real change before we can merge this in. Appreciate you adding a test case.
Comment on lines
3
to
4
| //go:build {{.BuildTags}} | ||
| // +build {{.BuildTags}} |
Collaborator
There was a problem hiding this comment.
The // +build syntax has been deprecated since Go 1.17. Let's remove it and only support //go:build.
protos/plugin/codegen.proto
Outdated
| bool emit_result_struct_pointers = 8; | ||
| bool emit_params_struct_pointers = 9; | ||
| bool emit_methods_with_db_argument = 10; | ||
| string build_tags = 29; |
Collaborator
There was a problem hiding this comment.
Can you add this to the end of the message instead of in the middle?
Co-authored-by: Kyle Gray <kyle@conroy.org>
Co-authored-by: Kyle Gray <kyle@conroy.org>
Co-authored-by: Kyle Gray <kyle@conroy.org>
Contributor
Author
|
Thank you for the review. I've made the corrections, so please check again. |
kyleconroy
approved these changes
Oct 6, 2023
alfonsodev
pushed a commit
to ExponentiaTeam/sqlc
that referenced
this pull request
Oct 13, 2025
…v#2807) * feat(codegen): add support for build tags (sqlc-dev#2012) * Update docs/reference/config.md * Update internal/codegen/golang/gen.go --------- Co-authored-by: Kyle Gray <kyle@conroy.org>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Attempt at adding the feature for #2012.
I am not a native English speaker, so some variable names might not be appropriate.
I've added a new
build_tagsoption, which gets inserted into the template when enabled.Fixes #2012