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

Method Query

batch.go:22–35  ·  batch.go::QueuedQuery.Query

Query sets fn to be called when the response to qq is received.

(fn func(rows Rows) error)

Source from the content-addressed store, hash-verified

20
21// Query sets fn to be called when the response to qq is received.
22func (qq *QueuedQuery) Query(fn func(rows Rows) error) {
23 qq.Fn = func(br BatchResults) error {
24 rows, _ := br.Query()
25 defer rows.Close()
26
27 err := fn(rows)
28 if err != nil {
29 return err
30 }
31 rows.Close()
32
33 return rows.Err()
34 }
35}
36
37// Query sets fn to be called when the response to qq is received.
38func (qq *QueuedQuery) QueryRow(fn func(row Row) error) {

Callers

nothing calls this directly

Calls 3

QueryMethod · 0.65
CloseMethod · 0.65
ErrMethod · 0.65

Tested by

no test coverage detected