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

Method NextRow

pgconn/pgconn.go:1759–1778  ·  view source on GitHub ↗

NextRow advances the ResultReader to the next row and returns true if a row is available.

()

Source from the content-addressed store, hash-verified

1757
1758// NextRow advances the ResultReader to the next row and returns true if a row is available.
1759func (rr *ResultReader) NextRow() bool {
1760 if rr.preloaded {
1761 rr.preloaded = false
1762 return true
1763 }
1764
1765 for !rr.commandConcluded {
1766 msg, err := rr.receiveMessage()
1767 if err != nil {
1768 return false
1769 }
1770
1771 if msg, ok := msg.(*pgproto3.DataRow); ok {
1772 rr.rowValues = msg.Values
1773 return true
1774 }
1775 }
1776
1777 return false
1778}
1779
1780func (rr *ResultReader) preloadRowValues(values [][]byte) {
1781 rr.rowValues = values

Calls 1

receiveMessageMethod · 0.95