Nodejs callback wrapper for Sequelize because using asCallback is error prone and every library should support callbacks as standard
options object must contain the following properties
- dbOpts - object that can be passed to Sequelize module
- dbs - object with keys being name of database to create or use, the value of object is an object with tables and dbOpts as property. The tables property defines the tables for relevant database and their schema whilst the dbOpts is the same as top level key encase you need to use a different database form the main declared one via an override.
- method to connect to database, callback has one param error if one occurred
- method to clean-up connection to database, as above callback has one param if an error occurs
- .dbs[dbName].tables[modelName].find(options, cb); - callback wrapped for Sequelize findAll method
- .dbs[dbName].tables[modelName].findById(options, cb); - callback wrapped for Sequelize findById method
- .dbs[dbName].tables[modelName].findOne(options, cb); - callback wrapped for Sequelize findOne method
- .dbs[dbName].tables[modelName].count(options, cb); - callback wrapped for Sequelize count method
- .dbs[dbName].tables[modelName].insertOne(record, options, cb); - callback wrapped for Sequelize create method
- .dbs[dbName].tables[modelName].insertMany(records, options, cb); - callback wrapped for Sequelize bulkCreate method
- .dbs[dbName].tables[modelName].deleteMany(options, cb); - callback wrapped for Sequelize destroy method
- .dbs[dbName].tables[modelName].deleteById(options, cb); - callback wrapped for Sequelize destroy method with where query for id set
- .dbs[dbName].tables[modelName].updateMany(records, options, cb); - callback wrapped for Sequelize update method with where query for id set
- .dbs[dbName].tables[modelName].drop(options, cb); - callback wrapped for Sequelize drop method, this will destroy the table completely
add tests- add CI with travis and appveyor
- improve docs
- clean up functionality
- improve method validation