How to SELECT / get all rows with node-sqlite3?

Viewed 9504

I am trying to get all / more than one row of data out of sqlite3 database that I previously entered and ensured that it(data) is present. With db as the database object, my attempt looks like this:

 db.get
    (
        'SELECT * FROM my_table',
        (err, rows) =>
        {
            if(rows && err === null)
            {
                console.log(rows);
            }
            else
            {
                console.log('Error', err);
            }
        }
    )

Above always returns a single object with 1 row of data.

1 Answers
Related