Skip to content

Commit 2a00574

Browse files
committed
Ignore deprecated settings
1 parent 0ed7a7d commit 2a00574

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

gen.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@ func buildEnums(req *plugin.CodeGenRequest) []Enum {
276276
return enums
277277
}
278278

279-
func buildModels(req *plugin.CodeGenRequest) []Struct {
279+
func buildModels(conf Config, req *plugin.CodeGenRequest) []Struct {
280280
var structs []Struct
281281
for _, schema := range req.Catalog.Schemas {
282282
if schema.Name == "pg_catalog" || schema.Name == "information_schema" {
@@ -290,10 +290,10 @@ func buildModels(req *plugin.CodeGenRequest) []Struct {
290290
tableName = schema.Name + "_" + table.Rel.Name
291291
}
292292
structName := tableName
293-
if !req.Settings.Python.EmitExactTableNames {
293+
if !conf.EmitExactTableNames {
294294
structName = inflection.Singular(inflection.SingularParams{
295295
Name: structName,
296-
Exclusions: req.Settings.Python.InflectionExcludeTableNames,
296+
Exclusions: conf.InflectionExcludeTableNames,
297297
})
298298
}
299299
s := Struct{
@@ -1097,7 +1097,7 @@ func Generate(_ context.Context, req *plugin.Request) (*plugin.Response, error)
10971097
}
10981098

10991099
enums := buildEnums(req)
1100-
models := buildModels(req)
1100+
models := buildModels(conf, req)
11011101
queries, err := buildQueries(conf, req, models)
11021102
if err != nil {
11031103
return nil, err

0 commit comments

Comments
 (0)