Actually I think I know what the problem is
It's on this line: const newResults = records.concat(queryResult.records)
. Your queryResult
does not have a records
property. Use console.log
to find the right one.
Here's a demo that gets all users from the example Postgres db. It uses offset/limit to imitate a cursor, but the principle is exactly the same.
Run the getAllUsers
JS query to test it.