Every example I can find on sqlite3 and nodejs just writes the data to the console, which is useless - how do I await a data and return it from a calling method ? Lets say I have :
exports.selectData = function(tableName, parameters, successHandler) {
var dbConn = new sqlite3.Database('./data/myAppsData.db');
dbConn.all("SELECT " + parameters + " FROM " + tableName + "", function(err, rows) {
// what to do here ? or somewhere else ?
});
}
How do I get data (rows) to return from selectData ? Or alternatively, using successHandler callback ? (it is undefined where the comment is)