HB Database Scripter
The database upgrade script executer.
Useness
Imagine you have several SQLs to execute to upgrade your database or table:
`commoditlow` ADD `buy_link_mobile` TEXT DEFAULT NULL;`boards` ADD `is_commoditlow_board` TINYINT(1) NOT NULL DEFAULT 0;
You want write down a script which you can run directly:
$ node script.js
You may use this module.
Installation
$ npm install hb-database-scripter
APIs
Scripter
Constructor
var Scripter = ;var scripter = processor;
Make sure that processor
is a function which is truelly run your sqls and the arguments are sql
and a callback
.
Eg.
Imagine your project has a global object db, and it may use as below:
db;Then you can use
db.query.bind(db)
as your processor.
push
Push your SQLs.
scripter;scripter;
exec
Execute your SQLs that you pushed parallelly:
scripter;
Who Uses This?
- Huaban.com
- maybe, you.
Contribution
You're welcome to fork and pull requests!