1.0.0 • Published 8 years ago
mysql-promise-edition v1.0.0
mysql-promise-edition
A wrapper for mysqljs/mysql that use Promise instead callback.
if a method not has a callback, it just proxy it.
Since Promise can only resolve one object, this package use a array to wrapper result.
like:
const mysql = require('mysql-promise-edition');
let pool = mysql.createPool({
host: 'host',
user: 'user',
password: 'password',
database: 'database'
});
pool.query('select * from table').then(function(result) {
let [results, fields] = result;
...
})
// or use a async function
(async () => {
let [results, fields] = await pool.query('select * from table');
...
})();
node >= 8.0
1.0.0
8 years ago