Skip to content

protos: Add missing field name #2354

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 3 commits into from
Jun 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .github/workflows/buf.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
name: buf
on: pull_request
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: bufbuild/buf-setup-action@v1
- uses: bufbuild/buf-lint-action@v1
2 changes: 2 additions & 0 deletions buf.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Generated by buf. DO NOT EDIT.
version: v1
7 changes: 7 additions & 0 deletions buf.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
version: v1
breaking:
use:
- FILE
lint:
use:
- DEFAULT
2 changes: 1 addition & 1 deletion internal/cmd/shim.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ func pluginGoCode(s config.SQLGo) *plugin.GoCode {
return &plugin.GoCode{
EmitInterface: s.EmitInterface,
EmitJsonTags: s.EmitJSONTags,
JsonTagsIDUppercase: s.JsonTagsIDUppercase,
JsonTagsIdUppercase: s.JsonTagsIDUppercase,
EmitDbTags: s.EmitDBTags,
EmitPreparedQueries: s.EmitPreparedQueries,
EmitExactTableNames: s.EmitExactTableNames,
Expand Down
2 changes: 1 addition & 1 deletion internal/codegen/golang/field.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ func TagsToString(tags map[string]string) string {

func JSONTagName(name string, settings *plugin.Settings) string {
style := settings.Go.JsonTagsCaseStyle
idUppercase := settings.Go.JsonTagsIDUppercase
idUppercase := settings.Go.JsonTagsIdUppercase
if style == "" || style == "none" {
return name
} else {
Expand Down
2 changes: 1 addition & 1 deletion internal/codegen/golang/gen.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ func generate(req *plugin.CodeGenRequest, enums []Enum, structs []Struct, querie
tctx := tmplCtx{
EmitInterface: golang.EmitInterface,
EmitJSONTags: golang.EmitJsonTags,
JsonTagsIDUppercase: golang.JsonTagsIDUppercase,
JsonTagsIDUppercase: golang.JsonTagsIdUppercase,
EmitDBTags: golang.EmitDbTags,
EmitPreparedQueries: golang.EmitPreparedQueries,
EmitEmptySlices: golang.EmitEmptySlices,
Expand Down
3 changes: 2 additions & 1 deletion internal/endtoend/testdata/codegen_json/gen/codegen.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@
"inflection_exclude_table_names": [],
"emit_pointers_for_null_types": false,
"query_parameter_limit": 1,
"output_batch_file_name": ""
"output_batch_file_name": "",
"json_tags_id_uppercase": false
},
"json": {
"out": "gen",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@
"inflection_exclude_table_names": [],
"emit_pointers_for_null_types": false,
"query_parameter_limit": 1,
"output_batch_file_name": ""
"output_batch_file_name": "",
"json_tags_id_uppercase": false
},
"json": {
"out": "",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@
"inflection_exclude_table_names": [],
"emit_pointers_for_null_types": false,
"query_parameter_limit": 1,
"output_batch_file_name": ""
"output_batch_file_name": "",
"json_tags_id_uppercase": false
},
"json": {
"out": "",
Expand Down
277 changes: 140 additions & 137 deletions internal/plugin/codegen.pb.go

Large diffs are not rendered by default.

68 changes: 36 additions & 32 deletions internal/plugin/codegen_vtproto.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions protos/plugin/codegen.proto
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ message GoCode
bool emit_pointers_for_null_types = 22;
optional int32 query_parameter_limit = 23;
string output_batch_file_name = 24;
bool json_tags_id_uppercase = 26;
}

message JSONCode
Expand Down