postgres
postgres copied to clipboard
Access columns data when using forEach/cursor
When using the .forEach or .cursor methods to iterate returned rows (in the case of large datasets) is there a way to access the column definition information prior to or during that iteration ?
and when have .forEach, why not have an index? a.k.a design it mimic Array.forEach better, like:
await sql ` <sql-to-generate-large-datasets> ` .forEach((row, index, array) => {}, thisArg)
Reference: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/forEach
in the form of .forEach((row, index, array) => {}, thisArg) I don't really care about array, thisArg but the index is really needed, and useful