I want to resolve all rows from request.on('row) in node.js - but its only possible with one row

151 Views Asked by At

I am working in node.js using tedious package and have connected to my database, (working with HTTP triggers).

The other Get requests i have made so far works - when its only one row im asking for.

But now im trying to retrieve all users in my database and when console.logging them i can see them all.

But the reply im getting through postman is only the first user.

Do you have any advise on how to showcase all users via postman.

Here is a snippet of the code - since the rest of the SQL statements works including the rest of the code, im considering that im requesting and resolving only one row with the following statement:

// From my DBconnection file

request.on('row', (columns) => {

// test in console

for( i of columns){
                let result = "";
                result += i.value;
                 console.log({result});
            };
 // resolving columns for API
            resolve(columns);

        });

In case its not enough information - please let me know how to make the question better :) Kind regards

0

There are 0 best solutions below