finemysql

1.0.0 • Public • Published

finemysql

Version npmNPM DownloadsDependencies

A tiny mysql wrapper that adds capabilities of immutability, promises, and carefree connections management.

Installation

$ npm i -S finemysql

Quick start

const mysql = require('../dist/index');
 
const db = new mysql({user: 'test', password: 'test', database: 'test'});
 
db.invoke('SELECT * FROM test')
    .then(data=> {
        console.log(data);
        console.log(data.isList()); //immutable Data
        console.log(data.first());
    });

Goal

finemysql was created just to simplify the use of nodejs driver for mysql. it uses bluebirdjs to convert old callbacks to promises, and immutablejs to keep your data reliable and consistent throughout your app. all those, along with a done right connections management, allow you to use mysql easier than ever before. Enjoy!

API

DB Class require('finemysql')

initialize(constructor):

Creates a new db instance.

const db = new mysql(options);

for the options list please refer to mysql module docs.

Methods:

Name Description Syntax Return Value
invoke() Runs the query with the escapeArr on the db instance. db.invoke(query, escapeArr = []); A promise with the result (Immutable collection) (can also be rejected to the catch).

Examples

for examples please look at the example page.

License

MIT

Package Sidebar

Install

npm i finemysql

Weekly Downloads

2

Version

1.0.0

License

MIT

Last publish

Collaborators

  • rannn505