2
0

Use pgproto3.FieldDescription instead of pgx version

This allows removing a malloc and memcpy.
This commit is contained in:
Jack Christensen
2019-05-04 13:47:03 -05:00
parent ea31df3b50
commit 583c8d3b25
7 changed files with 97 additions and 140 deletions
+8 -7
View File
@@ -1,6 +1,7 @@
package pool
import (
"github.com/jackc/pgproto3/v2"
"github.com/jackc/pgx/v4"
)
@@ -8,12 +9,12 @@ type errRows struct {
err error
}
func (errRows) Close() {}
func (e errRows) Err() error { return e.err }
func (errRows) FieldDescriptions() []pgx.FieldDescription { return nil }
func (errRows) Next() bool { return false }
func (e errRows) Scan(dest ...interface{}) error { return e.err }
func (e errRows) Values() ([]interface{}, error) { return nil, e.err }
func (errRows) Close() {}
func (e errRows) Err() error { return e.err }
func (errRows) FieldDescriptions() []pgproto3.FieldDescription { return nil }
func (errRows) Next() bool { return false }
func (e errRows) Scan(dest ...interface{}) error { return e.err }
func (e errRows) Values() ([]interface{}, error) { return nil, e.err }
type errRow struct {
err error
@@ -42,7 +43,7 @@ func (rows *poolRows) Err() error {
return rows.r.Err()
}
func (rows *poolRows) FieldDescriptions() []pgx.FieldDescription {
func (rows *poolRows) FieldDescriptions() []pgproto3.FieldDescription {
return rows.r.FieldDescriptions()
}