Answer the question
In order to leave comments, you need to log in
How to return a promise?
With node.js I use MySQL
after getting the result from the database, I still have a lot to do
function sendToBase () {
pool.getConnection(function (err, connection) {
if(err) {
debug(err);
return err;
}
connection.query(querySQL, function (err, rows) {
if (err) {
debug(err);
} else {
// возвращаем соединение в пул
connection.release();
console.log(rows) // Как вернуть столбцы?
}
});
});
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question