Skip to content

Commit 0c0a35e

Browse files
authored
fix copyfrom methods on interface not matching generated methods (#1424)
1 parent fab641e commit 0c0a35e

File tree

3 files changed

+19
-3
lines changed

3 files changed

+19
-3
lines changed

internal/codegen/golang/templates/pgx/interfaceCode.tmpl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@
2828
{{.MethodName}}(ctx context.Context, {{.Arg.Pair}}) (pgconn.CommandTag, error)
2929
{{- end}}
3030
{{- if and (eq .Cmd ":copyfrom") ($dbtxParam) }}
31-
{{.MethodName}}(ctx context.Context, db DBTX, {{.Arg.Pair}}) (int64, error)
31+
{{.MethodName}}(ctx context.Context, db DBTX, {{.Arg.SlicePair}}) (int64, error)
3232
{{- else if eq .Cmd ":copyfrom" }}
33-
{{.MethodName}}(ctx context.Context, {{.Arg.Pair}}) (int64, error)
33+
{{.MethodName}}(ctx context.Context, {{.Arg.SlicePair}}) (int64, error)
3434
{{- end}}
3535
{{- end}}
3636
}

internal/endtoend/testdata/copyfrom/postgresql/pgx/go/querier.go

Lines changed: 15 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

internal/endtoend/testdata/copyfrom/postgresql/pgx/sqlc.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77
"sql_package": "pgx/v4",
88
"name": "querytest",
99
"schema": "query.sql",
10-
"queries": "query.sql"
10+
"queries": "query.sql",
11+
"emit_interface": true
1112
}
1213
]
1314
}

0 commit comments

Comments
 (0)