不要怂,就是干,撸起袖子干!

Commit 0de42d92 by sdepold

made dialects dynamic + fixed logging

1 parent 1b9b44cd
Showing with 9 additions and 1 deletions
const Sequelize = require(__dirname + "/../index")
, DataTypes = require(__dirname + "/../lib/data-types")
, config = require(__dirname + "/config/config")
, fs = require('fs')
var BusterHelpers = module.exports = {
initTests: function(options) {
......@@ -16,13 +17,14 @@ var BusterHelpers = module.exports = {
options = options || {}
options.dialect = options.dialect || 'mysql'
options.logging = (options.hasOwnProperty('logging') ? options.logging : false)
return new Sequelize(
config[options.dialect].database,
config[options.dialect].username,
config[options.dialect].password,
{
logging: false,
logging: options.logging,
dialect: options.dialect,
port: config[options.dialect].port
}
......@@ -38,5 +40,11 @@ var BusterHelpers = module.exports = {
callback && callback()
})
.error(function(err) { console.log(err) })
},
getSupportedDialects: function() {
return fs.readdirSync(__dirname + '/../lib/dialects').filter(function(file) {
return (file.indexOf('.js') === -1)
})
}
}
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!