mirror of https://github.com/jackc/pgx.git
add missing pgx pool release for QueryRow
parent
23b4656fc5
commit
c9e271df29
|
@ -96,7 +96,7 @@ type Config struct {
|
|||
// AfterConnect is called after a connection is established, but before it is added to the pool.
|
||||
AfterConnect func(context.Context, *pgx.Conn) error
|
||||
|
||||
// BeforeAcquire is called before before a connection is acquired from the pool. It must return true to allow the
|
||||
// BeforeAcquire is called before a connection is acquired from the pool. It must return true to allow the
|
||||
// acquision or false to indicate that the connection should be destroyed and a different connection should be
|
||||
// acquired.
|
||||
BeforeAcquire func(context.Context, *pgx.Conn) bool
|
||||
|
@ -458,6 +458,7 @@ func (p *Pool) QueryRow(ctx context.Context, sql string, args ...interface{}) pg
|
|||
if err != nil {
|
||||
return errRow{err: err}
|
||||
}
|
||||
defer c.Release()
|
||||
|
||||
row := c.QueryRow(ctx, sql, args...)
|
||||
return c.getPoolRow(row)
|
||||
|
|
Loading…
Reference in New Issue