Skip to content
Merged
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
12 changes: 6 additions & 6 deletions internal/gen.go
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ func makePyType(req *plugin.GenerateRequest, col *plugin.Column) pyType {
}
}
}

// No override found, use the standard type mapping
typ := pyInnerType(req, col)
return pyType{
Expand Down Expand Up @@ -253,9 +253,9 @@ func methodName(name string) string {
var pyIdentPattern = regexp.MustCompile("[^a-zA-Z0-9_]+")

func pyEnumValueName(value string) string {
id := strings.Replace(value, "-", "_", -1)
id = strings.Replace(id, ":", "_", -1)
id = strings.Replace(id, "/", "_", -1)
id := strings.ReplaceAll(value, "-", "_")
id = strings.ReplaceAll(id, ":", "_")
id = strings.ReplaceAll(id, "/", "_")
id = pyIdentPattern.ReplaceAllString(id, "")
return strings.ToUpper(id)
}
Expand Down Expand Up @@ -440,7 +440,7 @@ func buildQueries(conf Config, req *plugin.GenerateRequest, structs []Struct) ([
gq.Args = []QueryValue{{
Emit: true,
Name: "arg",
Struct: columnsToStruct(req, query.Name+"Params", cols),
Struct: columnsToStruct(req, modelName(query.Name+"Params", req.Settings), cols),
}}
} else {
args := make([]QueryValue, 0, len(query.Params))
Expand Down Expand Up @@ -495,7 +495,7 @@ func buildQueries(conf Config, req *plugin.GenerateRequest, structs []Struct) ([
Column: c,
})
}
gs = columnsToStruct(req, query.Name+"Row", columns)
gs = columnsToStruct(req, modelName(query.Name+"Row", req.Settings), columns)
emit = true
}
gq.Ret = QueryValue{
Expand Down