Library
MySql
before 8.0: mysql
Tip:
- To be able to have NULL value, you need to declare the column NULLABLE. See test-type-cast-null-fields.js
promise with mysql example
return new Promise(function(resolve, reject) {
// Async call
connection.query(
'SELECT * FROM `books` WHERE `author` = "David"',
function (error, results, fields){
if (error) {
reject(error);
} else {
resolve(results);
}
})
})