| 96 | }, |
| 97 | |
| 98 | createSequelizeInstance(options) { |
| 99 | options = options || {}; |
| 100 | options.dialect = this.getTestDialect(); |
| 101 | |
| 102 | const config = Config[options.dialect]; |
| 103 | |
| 104 | const sequelizeOptions = _.defaults(options, { |
| 105 | host: options.host || config.host, |
| 106 | logging: process.env.SEQ_LOG ? console.log : false, |
| 107 | dialect: options.dialect, |
| 108 | port: options.port || process.env.SEQ_PORT || config.port, |
| 109 | pool: config.pool, |
| 110 | dialectOptions: options.dialectOptions || config.dialectOptions || {}, |
| 111 | minifyAliases: options.minifyAliases || config.minifyAliases |
| 112 | }); |
| 113 | |
| 114 | if (process.env.DIALECT === class="st">'postgres-native') { |
| 115 | sequelizeOptions.native = true; |
| 116 | } |
| 117 | |
| 118 | if (config.storage || config.storage === class="st">'') { |
| 119 | sequelizeOptions.storage = config.storage; |
| 120 | } |
| 121 | |
| 122 | return this.getSequelizeInstance(config.database, config.username, config.password, sequelizeOptions); |
| 123 | }, |
| 124 | |
| 125 | getConnectionOptionsWithoutPool() { |
| 126 | class="cm">// Do not break existing config object - shallow clone before `delete config.pool` |