mysql-as-promised

0.2.2 • Public • Published

mysql-as-promised Build Status

Yet another mysql wrapper using promises.

Why yet another?

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.

Installation

npm install --save mysql-as-promised

Usage

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();

To do

  • Complete the API (I implemented only what I needed).

License

MIT

Readme

Keywords

none

Package Sidebar

Install

npm i mysql-as-promised

Weekly Downloads

2

Version

0.2.2

License

MIT

Last publish

Collaborators

  • mvila