Skip to content

Commit

Permalink
chore: fix extra newline in comments for copyfrom (#1438)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexdulin committed Feb 15, 2022
1 parent 194065e commit 6f783cd
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
4 changes: 2 additions & 2 deletions internal/codegen/golang/templates/pgx/copyfromCopy.tmpl
Expand Up @@ -37,10 +37,10 @@ func (r iteratorFor{{.MethodName}}) Err() error {

{{range .Comments}}//{{.}}
{{end -}}
{{- if $.EmitMethodsWithDBArgument}}
{{- if $.EmitMethodsWithDBArgument -}}
func (q *Queries) {{.MethodName}}(ctx context.Context, db DBTX, {{.Arg.SlicePair}}) (int64, error) {
return db.CopyFrom(ctx, {{.TableIdentifier}}, {{.Arg.ColumnNames}}, &iteratorFor{{.MethodName}}{rows: {{.Arg.Name}}})
{{- else}}
{{- else -}}
func (q *Queries) {{.MethodName}}(ctx context.Context, {{.Arg.SlicePair}}) (int64, error) {
return q.db.CopyFrom(ctx, {{.TableIdentifier}}, {{.Arg.ColumnNames}}, &iteratorFor{{.MethodName}}{rows: {{.Arg.Name}}})
{{- end}}
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions internal/endtoend/testdata/copyfrom/postgresql/pgx/query.sql
Expand Up @@ -2,7 +2,9 @@ CREATE SCHEMA myschema;
CREATE TABLE myschema.foo (a text, b integer);

-- name: InsertValues :copyfrom
-- InsertValues inserts multiple values using copy.
INSERT INTO myschema.foo (a, b) VALUES ($1, $2);

-- name: InsertSingleValue :copyfrom
-- InsertSingleValue inserts a single value using copy.
INSERT INTO myschema.foo (a) VALUES ($1);

0 comments on commit 6f783cd

Please sign in to comment.