2
0

Add pgconn.CheckConn

This commit is contained in:
Jack Christensen
2022-06-25 15:55:09 -05:00
parent b068d53753
commit 72b1dcff2f
5 changed files with 124 additions and 23 deletions
+10 -1
View File
@@ -13,6 +13,7 @@ import (
"time"
"github.com/jackc/pgx/v5"
"github.com/jackc/pgx/v5/internal/nbconn"
"github.com/jackc/pgx/v5/pgconn"
"github.com/jackc/pgx/v5/pgtype"
"github.com/stretchr/testify/require"
@@ -1236,7 +1237,7 @@ func BenchmarkSelectRowsPgConnExecPrepared(b *testing.B) {
}
type queryRecorder struct {
conn net.Conn
conn nbconn.Conn
writeBuf []byte
readCount int
}
@@ -1252,6 +1253,14 @@ func (qr *queryRecorder) Write(b []byte) (n int, err error) {
return qr.conn.Write(b)
}
func (qr *queryRecorder) BufferReadUntilBlock() error {
return qr.conn.BufferReadUntilBlock()
}
func (qr *queryRecorder) Flush() error {
return qr.conn.Flush()
}
func (qr *queryRecorder) Close() error {
return qr.conn.Close()
}