(err, result)
| 693 | const nextPage = () => promiseUtils.toCallback(this._execute(query, params, execOptions), pageCallback); |
| 694 | |
| 695 | function pageCallback (err, result) { |
| 696 | if (err) { |
| 697 | return callback(err); |
| 698 | } |
| 699 | // Next requests in case paging (auto or explicit) is used |
| 700 | rowLength += result.rowLength; |
| 701 | |
| 702 | if (result.rawPageState !== undefined) { |
| 703 | // Use new page state as next request page state |
| 704 | execOptions.setPageState(result.rawPageState); |
| 705 | if (execOptions.isAutoPage()) { |
| 706 | // Issue next request for the next page |
| 707 | return nextPage(); |
| 708 | } |
| 709 | // Allows for explicit (manual) paging, in case the caller needs it |
| 710 | result.nextPage = nextPage; |
| 711 | } |
| 712 | |
| 713 | // Finished auto-paging |
| 714 | result.rowLength = rowLength; |
| 715 | callback(null, result); |
| 716 | } |
| 717 | |
| 718 | promiseUtils.toCallback(this._execute(query, params, execOptions), pageCallback); |
| 719 | }; |
nothing calls this directly
no test coverage detected