Yet another mysql wrapper using promises.
Because every wrapper I found does things that I don't want:
- I don't want a dependency on a promise library (or native-or-bluebird). ES6 is there now, and if it isn't, there are polyfills.
- I don't want a different API than the original mysql module. I just want the same API with promises.
npm install --save mysql-as-promised
import mysql from 'mysql-as-promised';
let pool = mysql.createPool('mysql://test@localhost/test');
let connection = await pool.getConnection();
let rows = await connection.query('SELECT ? + ? AS solution', [2, 3]);
console.log(rows[0].solution); // => 5
connection.release();
await pool.end();
- Complete the API (I implemented only what I needed).
MIT