pgtype.OID type should only be used for scanning and encoding values
It was a mistake to use it in other contexts. This made interop difficult between pacakges that depended on pgtype such as pgx and packages that did not like pgconn and pgproto3. In particular this was awkward for prepared statements. This is preparation for removing pgx.PreparedStatement in favor of pgconn.PreparedStatement.
This commit is contained in:
@@ -4,14 +4,13 @@ import (
|
||||
"context"
|
||||
|
||||
"github.com/jackc/pgconn"
|
||||
"github.com/jackc/pgtype"
|
||||
errors "golang.org/x/xerrors"
|
||||
)
|
||||
|
||||
type batchItem struct {
|
||||
query string
|
||||
arguments []interface{}
|
||||
parameterOIDs []pgtype.OID
|
||||
parameterOIDs []uint32
|
||||
resultFormatCodes []int16
|
||||
}
|
||||
|
||||
@@ -24,7 +23,7 @@ type Batch struct {
|
||||
// Queue queues a query to batch b. query can be an SQL query or the name of a prepared statement. parameterOIDs and
|
||||
// resultFormatCodes should be nil if query is a prepared statement. Otherwise, parameterOIDs are required if there are
|
||||
// parameters and resultFormatCodes are required if there is a result.
|
||||
func (b *Batch) Queue(query string, arguments []interface{}, parameterOIDs []pgtype.OID, resultFormatCodes []int16) {
|
||||
func (b *Batch) Queue(query string, arguments []interface{}, parameterOIDs []uint32, resultFormatCodes []int16) {
|
||||
b.items = append(b.items, &batchItem{
|
||||
query: query,
|
||||
arguments: arguments,
|
||||
|
||||
Reference in New Issue
Block a user