File tree Expand file tree Collapse file tree 1 file changed +24
-22
lines changed
internal/tools/sqlc-pg-gen Expand file tree Collapse file tree 1 file changed +24
-22
lines changed Original file line number Diff line number Diff line change @@ -52,31 +52,33 @@ import (
52
52
"github.com/kyleconroy/sqlc/internal/sql/catalog"
53
53
)
54
54
55
- func {{.GenFnName}}() *catalog.Schema {
56
- s := &catalog.Schema{Name: "{{ .SchemaName }}"}
57
- s.Funcs = []*catalog.Function{
58
- {{- range .Procs}}
59
- {
55
+ var funcs{{.GenFnName}} = []*catalog.Function {
56
+ {{- range .Procs}}
57
+ {
58
+ Name: "{{.Name}}",
59
+ Args: []*catalog.Argument{
60
+ {{range .Args}}{
61
+ {{- if .Name}}
60
62
Name: "{{.Name}}",
61
- Args: []*catalog.Argument{
62
- {{range .Args}}{
63
- {{- if .Name}}
64
- Name: "{{.Name}}",
65
- {{- end}}
66
- {{- if .HasDefault}}
67
- HasDefault: true,
68
- {{- end}}
69
- Type: &ast.TypeName{Name: "{{.TypeName}}"},
70
- {{- if ne .Mode "i" }}
71
- Mode: {{ .GoMode }},
72
- {{- end}}
73
- },
74
- {{end}}
63
+ {{- end}}
64
+ {{- if .HasDefault}}
65
+ HasDefault: true,
66
+ {{- end}}
67
+ Type: &ast.TypeName{Name: "{{.TypeName}}"},
68
+ {{- if ne .Mode "i" }}
69
+ Mode: {{ .GoMode }},
70
+ {{- end}}
75
71
},
76
- ReturnType: &ast.TypeName{Name: "{{.ReturnTypeName}}"},
72
+ {{end}}
77
73
},
78
- {{- end}}
79
- }
74
+ ReturnType: &ast.TypeName{Name: "{{.ReturnTypeName}}"},
75
+ },
76
+ {{- end}}
77
+ }
78
+
79
+ func {{.GenFnName}}() *catalog.Schema {
80
+ s := &catalog.Schema{Name: "{{ .SchemaName }}"}
81
+ s.Funcs = funcs{{.GenFnName}}
80
82
{{- if .Relations }}
81
83
s.Tables = []*catalog.Table {
82
84
{{- range .Relations }}
You can’t perform that action at this time.
0 commit comments