Skip to content

Commit

Permalink
Fix code geneation for sqlc.slice
Browse files Browse the repository at this point in the history
Fixes #2430
  • Loading branch information
SoMuchForSubtlety committed Jul 11, 2023
1 parent 64e6c9c commit 8ec7acb
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions internal/codegen/golang/templates/stdlib/queryCode.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,11 @@ func (q *Queries) {{.MethodName}}(ctx context.Context, {{ dbarg }} {{.Arg.Pair}}
query = strings.Replace(query, "/*SLICE:{{.Arg.Column.Name}}*/?", "NULL", 1)
}
{{- end }}
{{- if emitPreparedQueries }}
{{ queryRetval . }} {{ queryMethod . }}(ctx, nil, query, queryParams...)
{{- else}}
{{ queryRetval . }} {{ queryMethod . }}(ctx, query, queryParams...)
{{- end -}}
{{- else if emitPreparedQueries }}
{{- queryRetval . }} {{ queryMethod . }}(ctx, q.{{.FieldName}}, {{.ConstantName}}, {{.Arg.Params}})
{{- else}}
Expand Down

0 comments on commit 8ec7acb

Please sign in to comment.