Skip to content
This repository has been archived by the owner on Dec 22, 2020. It is now read-only.

object-layer/mysql-as-promised

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Yet another mysql wrapper using promises

Resources

Stars

Watchers

Forks

Packages

No packages published