File tree Expand file tree Collapse file tree
endtoend/testdata/overrides_go_struct_tags/invalid_tags Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -33,17 +33,17 @@ type Override struct {
3333 // fully qualified name of the column, e.g. `accounts.id`
3434 Column string `json:"column" yaml:"column"`
3535
36- ColumnName * pattern.Match
37- TableCatalog * pattern.Match
38- TableSchema * pattern.Match
39- TableRel * pattern.Match
40- GoImportPath string
41- GoPackage string
42- GoTypeName string
43- GoBasicType bool
36+ ColumnName * pattern.Match `json:"-"`
37+ TableCatalog * pattern.Match `json:"-"`
38+ TableSchema * pattern.Match `json:"-"`
39+ TableRel * pattern.Match `json:"-"`
40+ GoImportPath string `json:"-"`
41+ GoPackage string `json:"-"`
42+ GoTypeName string `json:"-"`
43+ GoBasicType bool `json:"-"`
4444
4545 // Parsed form of GoStructTag, e.g. {"validate:", "required"}
46- GoStructTags map [string ]string
46+ GoStructTags map [string ]string `json:"-"`
4747}
4848
4949func (o * Override ) Parse () (err error ) {
Original file line number Diff line number Diff line change @@ -269,7 +269,6 @@ func Combine(conf Config, pkg SQL) CombinedSettings {
269269 for k , v := range pkg .Gen .Go .Rename {
270270 cs .Rename [k ] = v
271271 }
272- cs .Overrides = append (cs .Overrides , pkg .Gen .Go .Overrides ... )
273272 }
274273 if pkg .Gen .JSON != nil {
275274 cs .JSON = * pkg .Gen .JSON
Original file line number Diff line number Diff line change @@ -35,17 +35,17 @@ type Override struct {
3535 // fully qualified name of the column, e.g. `accounts.id`
3636 Column string `json:"column" yaml:"column"`
3737
38- ColumnName * pattern.Match
39- TableCatalog * pattern.Match
40- TableSchema * pattern.Match
41- TableRel * pattern.Match
42- GoImportPath string
43- GoPackage string
44- GoTypeName string
45- GoBasicType bool
38+ ColumnName * pattern.Match `json:"-"`
39+ TableCatalog * pattern.Match `json:"-"`
40+ TableSchema * pattern.Match `json:"-"`
41+ TableRel * pattern.Match `json:"-"`
42+ GoImportPath string `json:"-"`
43+ GoPackage string `json:"-"`
44+ GoTypeName string `json:"-"`
45+ GoBasicType bool `json:"-"`
4646
4747 // Parsed form of GoStructTag, e.g. {"validate:", "required"}
48- GoStructTags map [string ]string
48+ GoStructTags map [string ]string `json:"-"`
4949}
5050
5151func (o * Override ) Parse () (err error ) {
Original file line number Diff line number Diff line change @@ -96,18 +96,13 @@ func v1ParseConfig(rd io.Reader) (Config, error) {
9696 * settings .Packages [j ].QueryParameterLimit = 1
9797 }
9898
99- for i := range settings .Packages [j ].Overrides {
100- if err := settings .Packages [j ].Overrides [i ].Parse (); err != nil {
101- return config , err
102- }
103- }
10499 if settings .Packages [j ].Name == "" {
105100 settings .Packages [j ].Name = filepath .Base (settings .Packages [j ].Path )
106101 }
102+
107103 if settings .Packages [j ].Engine == "" {
108104 settings .Packages [j ].Engine = EnginePostgreSQL
109105 }
110-
111106 }
112107
113108 return settings .Translate (), nil
Original file line number Diff line number Diff line change @@ -84,11 +84,6 @@ func v2ParseConfig(rd io.Reader) (Config, error) {
8484 * conf .SQL [j ].Gen .Go .QueryParameterLimit = 1
8585 }
8686
87- for i := range conf .SQL [j ].Gen .Go .Overrides {
88- if err := conf .SQL [j ].Gen .Go .Overrides [i ].Parse (); err != nil {
89- return conf , err
90- }
91- }
9287 for k , v := range conf .SQL [j ].Gen .Go .Rename {
9388 conf .SQL [j ].Gen .Go .Rename [k ] = v
9489 }
Original file line number Diff line number Diff line change 1- error parsing sqlc.json: bad syntax for struct tag pair
1+ # package override
2+ error generating code: bad syntax for struct tag pair
You can’t perform that action at this time.
0 commit comments