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

Method receiveMessage

pgconn/pgconn.go:1595–1615  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1593}
1594
1595func (mrr *MultiResultReader) receiveMessage() (pgproto3.BackendMessage, error) {
1596 msg, err := mrr.pgConn.receiveMessage()
1597 if err != nil {
1598 mrr.pgConn.contextWatcher.Unwatch()
1599 mrr.err = normalizeTimeoutError(mrr.ctx, err)
1600 mrr.closed = true
1601 mrr.pgConn.asyncClose()
1602 return nil, mrr.err
1603 }
1604
1605 switch msg := msg.(type) {
1606 case *pgproto3.ReadyForQuery:
1607 mrr.closed = true
1608 mrr.pgConn.contextWatcher.Unwatch()
1609 mrr.pgConn.unlock()
1610 case *pgproto3.ErrorResponse:
1611 mrr.err = ErrorResponseToPgError(msg)
1612 }
1613
1614 return msg, nil
1615}
1616
1617// NextResult returns advances the MultiResultReader to the next result and returns true if a result is available.
1618func (mrr *MultiResultReader) NextResult() bool {

Callers 2

NextResultMethod · 0.95
CloseMethod · 0.95

Calls 6

normalizeTimeoutErrorFunction · 0.85
ErrorResponseToPgErrorFunction · 0.85
UnwatchMethod · 0.80
asyncCloseMethod · 0.80
unlockMethod · 0.80
receiveMessageMethod · 0.45

Tested by

no test coverage detected