Query sets fn to be called when the response to qq is received.
(fn func(rows Rows) error)
| 20 | |
| 21 | // Query sets fn to be called when the response to qq is received. |
| 22 | func (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. |
| 38 | func (qq *QueuedQuery) QueryRow(fn func(row Row) error) { |