mysql-bluebird

0.0.3 • Public • Published

MySQL Bluebird

Bluebird wrapper for MySQL

Installation

You can install this module via npm:

npm install mysql-bluebird

Example Usage

// Require the module.
var MySQL = require('mysql-bluebird');
var Promise = require('bluebird');
 
// Pass your connection options to the constructor.
var db = new MySQL({
  "host": "127.0.0.1",
  "port": 3306,
  "database": "name",
  "user": "user",
  "password": "password"
});
 
Promise.resolve()
  .then(function () {
    // Call the start function which will connect to the database.
    return db.start();
  }).then(function () {
    // Perform a query to the database to get all the rows from the test table.
    return db.query('SELECT * FROM test');
  }).then(function (res) {
    // Console print the returned rows.
    console.log(res);
  });

Readme

Keywords

Package Sidebar

Install

npm i mysql-bluebird

Weekly Downloads

2

Version

0.0.3

License

MIT

Last publish

Collaborators

  • artdude543