()
| 89 | const cursor = this.pgCursor(text, values) |
| 90 | let count = 0 |
| 91 | const read = function () { |
| 92 | cursor.read(100, function (err, rows) { |
| 93 | if (err) return done(err) |
| 94 | if (!rows.length) { |
| 95 | assert.strictEqual(count, 100001) |
| 96 | return done() |
| 97 | } |
| 98 | count += rows.length |
| 99 | if (count % 10000 === 0) { |
| 100 | // console.log(count) |
| 101 | } |
| 102 | setImmediate(read) |
| 103 | }) |
| 104 | } |
| 105 | read() |
| 106 | }) |
| 107 |