(options)
| 104 | }, |
| 105 | |
| 106 | createSequelizeInstance(options) { |
| 107 | options = options || {}; |
| 108 | options.dialect = Support.getTestDialect(); |
| 109 | |
| 110 | const config = Config[options.dialect]; |
| 111 | |
| 112 | const sequelizeOptions = _.defaults(options, { |
| 113 | host: options.host || config.host, |
| 114 | logging: process.env.SEQ_LOG ? console.log : false, |
| 115 | dialect: options.dialect, |
| 116 | port: options.port || process.env.SEQ_PORT || config.port, |
| 117 | pool: config.pool, |
| 118 | dialectOptions: options.dialectOptions || config.dialectOptions || {}, |
| 119 | minifyAliases: options.minifyAliases || config.minifyAliases |
| 120 | }); |
| 121 | |
| 122 | if (process.env.DIALECT === 'postgres-native') { |
| 123 | sequelizeOptions.native = true; |
| 124 | } |
| 125 | |
| 126 | if (config.storage || config.storage === '') { |
| 127 | sequelizeOptions.storage = config.storage; |
| 128 | } |
| 129 | |
| 130 | return Support.getSequelizeInstance(config.database, config.username, config.password, sequelizeOptions); |
| 131 | }, |
| 132 | |
| 133 | getConnectionOptionsWithoutPool() { |
| 134 | // Do not break existing config object - shallow clone before `delete config.pool` |
no outgoing calls