Skip to content

quentinadam/node-mysql-promise-wrapper

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

node-mysql-promise-wrapper

Wrapper for mysql with ES6 Promises

Installation

npm install mysql-promise-wrapper

Usage

const Database = require("mysql-promise-wrapper");

let database = new Database({
    host     : 'localhost',
    user     : 'me',
    password : 'secret',
    database : 'db'
});

database.query("SELECT * FROM items WHERE property = ?", ["value"]).then((rows) => {
    console.log(rows);
});

database.connection((connection) => {
    return connection.query("SELECT * FROM items WHERE property = ?", ["value"])
}).then((rows) => {
    console.log(rows);
});

About

Wrapper for mysql with ES6 Promises

Resources

Stars

Watchers

Forks

Packages

No packages published