queryqueue
v0.0.7
Published
A simple database query queing module
Downloads
1
Readme
QueryQueue
A simple database query queing module
Installation
npm install queryqueue
Usage
Configure
In app.js
or something once
var QueryQueue = require('queryqueue');
QueryQueue.config({
host: "localhost",
user: "user",
password: "password",
database: "database"
});
Config
takes same parameter options as that of mysql.createPool
Use
var QueryQueue = require('queryqueue');
var runner = QueryQueue.Runner(function (result) {
console.log("countries", result.countries);
console.log("admins", result.users.admins);
console.log("managers", result.users.managers);
});
runner.add("countries","select name from countries");
runner.add("users.admins","select name from users where admin = 1");
runner.add("users.managers","select name from users where manager = 1");
runner.start();
Tests
npm test
More Info
A detailed blog post on Query Queue.
Contributing
In lieu of a formal style guide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code.