Skip to content

Commit 8ec7acb

Browse files
Fix code geneation for sqlc.slice
Fixes #2430
1 parent 64e6c9c commit 8ec7acb

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

internal/codegen/golang/templates/stdlib/queryCode.tmpl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,11 @@ func (q *Queries) {{.MethodName}}(ctx context.Context, {{ dbarg }} {{.Arg.Pair}}
142142
query = strings.Replace(query, "/*SLICE:{{.Arg.Column.Name}}*/?", "NULL", 1)
143143
}
144144
{{- end }}
145+
{{- if emitPreparedQueries }}
146+
{{ queryRetval . }} {{ queryMethod . }}(ctx, nil, query, queryParams...)
147+
{{- else}}
145148
{{ queryRetval . }} {{ queryMethod . }}(ctx, query, queryParams...)
149+
{{- end -}}
146150
{{- else if emitPreparedQueries }}
147151
{{- queryRetval . }} {{ queryMethod . }}(ctx, q.{{.FieldName}}, {{.ConstantName}}, {{.Arg.Params}})
148152
{{- else}}

0 commit comments

Comments
 (0)