NextRow advances the ResultReader to the next row and returns true if a row is available.
()
| 1757 | |
| 1758 | // NextRow advances the ResultReader to the next row and returns true if a row is available. |
| 1759 | func (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 | |
| 1780 | func (rr *ResultReader) preloadRowValues(values [][]byte) { |
| 1781 | rr.rowValues = values |