@@ -58,6 +58,10 @@ func (c *Conn) QueryRow(ctx context.Context, sql string, args ...interface{}) pg
|
||||
return c.Conn().QueryRow(ctx, sql, args...)
|
||||
}
|
||||
|
||||
func (c *Conn) QueryFunc(ctx context.Context, sql string, args []interface{}, scans []interface{}, f func(pgx.QueryFuncRow) error) (pgconn.CommandTag, error) {
|
||||
return c.Conn().QueryFunc(ctx, sql, args, scans, f)
|
||||
}
|
||||
|
||||
func (c *Conn) SendBatch(ctx context.Context, b *pgx.Batch) pgx.BatchResults {
|
||||
return c.Conn().SendBatch(ctx, b)
|
||||
}
|
||||
|
||||
@@ -430,6 +430,16 @@ func (p *Pool) QueryRow(ctx context.Context, sql string, args ...interface{}) pg
|
||||
return c.getPoolRow(row)
|
||||
}
|
||||
|
||||
func (p *Pool) QueryFunc(ctx context.Context, sql string, args []interface{}, scans []interface{}, f func(pgx.QueryFuncRow) error) (pgconn.CommandTag, error) {
|
||||
c, err := p.Acquire(ctx)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
defer c.Release()
|
||||
|
||||
return c.QueryFunc(ctx, sql, args, scans, f)
|
||||
}
|
||||
|
||||
func (p *Pool) SendBatch(ctx context.Context, b *pgx.Batch) pgx.BatchResults {
|
||||
c, err := p.Acquire(ctx)
|
||||
if err != nil {
|
||||
|
||||
@@ -62,6 +62,10 @@ func (tx *Tx) QueryRow(ctx context.Context, sql string, args ...interface{}) pgx
|
||||
return tx.t.QueryRow(ctx, sql, args...)
|
||||
}
|
||||
|
||||
func (tx *Tx) QueryFunc(ctx context.Context, sql string, args []interface{}, scans []interface{}, f func(pgx.QueryFuncRow) error) (pgconn.CommandTag, error) {
|
||||
return tx.t.QueryFunc(ctx, sql, args, scans, f)
|
||||
}
|
||||
|
||||
func (tx *Tx) Conn() *pgx.Conn {
|
||||
return tx.t.Conn()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user