MCPcopy
hub / github.com/jackc/pgx / QueryRow

Method QueryRow

pgxpool/pool.go:774–782  ·  view source on GitHub ↗

QueryRow acquires a connection and executes a query that is expected to return at most one row ([pgx.Row]). Errors are deferred until [pgx.Row]'s Scan method is called. If the query selects no rows, [pgx.Row]'s Scan will return [pgx.ErrNoRows]. Otherwise, [pgx.Row]'s Scan scans the first selected ro

(ctx context.Context, sql string, args ...any)

Source from the content-addressed store, hash-verified

772// [pgx.QueryResultFormatsByOID] may be used as the first args to control exactly how the query is executed. This is rarely
773// needed. See the documentation for those types for details.
774func (p *Pool) QueryRow(ctx context.Context, sql string, args ...any) pgx.Row {
775 c, err := p.Acquire(ctx)
776 if err != nil {
777 return errRow{err: err}
778 }
779
780 row := c.QueryRow(ctx, sql, args...)
781 return c.getPoolRow(row)
782}
783
784func (p *Pool) SendBatch(ctx context.Context, b *pgx.Batch) pgx.BatchResults {
785 c, err := p.Acquire(ctx)

Callers

nothing calls this directly

Calls 3

AcquireMethod · 0.95
QueryRowMethod · 0.65
getPoolRowMethod · 0.45

Tested by

no test coverage detected