2
0

Expose pgx functionality for manual integration with pgconn

This is primarily useful for using pipeline mode.
This commit is contained in:
Jack Christensen
2022-07-04 08:36:05 -05:00
parent f7433cc5f2
commit 1168b375e4
6 changed files with 289 additions and 215 deletions
+3 -3
View File
@@ -116,12 +116,12 @@ func (br *batchResults) Query() (Rows, error) {
}
if br.err != nil {
return &connRows{err: br.err, closed: true}, br.err
return &baseRows{err: br.err, closed: true}, br.err
}
if br.closed {
alreadyClosedErr := fmt.Errorf("batch already closed")
return &connRows{err: alreadyClosedErr, closed: true}, alreadyClosedErr
return &baseRows{err: alreadyClosedErr, closed: true}, alreadyClosedErr
}
rows := br.conn.getRows(br.ctx, query, arguments)
@@ -182,7 +182,7 @@ func (br *batchResults) QueryFunc(scans []any, f func(QueryFuncRow) error) (pgco
// QueryRow reads the results from the next query in the batch as if the query has been sent with QueryRow.
func (br *batchResults) QueryRow() Row {
rows, _ := br.Query()
return (*connRow)(rows.(*connRows))
return (*connRow)(rows.(*baseRows))
}