Skip to content

Commit 8b5075b

Browse files
authored
Ignore deprecated settings (sqlc-dev#1)
1 parent 0ed7a7d commit 8b5075b

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
returnenums
277277
}
278278

279-
funcbuildModels(req*plugin.CodeGenRequest) []Struct{
279+
funcbuildModels(confConfig, req*plugin.CodeGenRequest) []Struct{
280280
varstructs []Struct
281281
for_, schema:=rangereq.Catalog.Schemas{
282282
ifschema.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
iferr!=nil{
11031103
returnnil, err

0 commit comments

Comments
(0)