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

Commit 856be984 by Sascha Depold

dialectOptions

1 parent e2a2c654
......@@ -265,9 +265,9 @@ module.exports = (function() {
timezone: 'Z'
};
if (config.connectionOptions) {
Object.keys(config.connectionOptions).forEach(function (key) {
connectionConfig[key] = config.connectionOptions[key];
if (config.dialectOptions) {
Object.keys(config.dialectOptions).forEach(function (key) {
connectionConfig[key] = config.dialectOptions[key];
});
}
......
......@@ -104,7 +104,7 @@ module.exports = (function() {
replication: this.options.replication,
dialectModulePath: this.options.dialectModulePath,
maxConcurrentQueries: this.options.maxConcurrentQueries,
connectionOptions: this.options.connectionOptions,
dialectOptions: this.options.dialectOptions,
}
try {
......
......@@ -103,7 +103,7 @@ describe(Support.getTestDialectTeaser("Configuration"), function() {
it('should accept four parameters (database, username, password, options)', function(done) {
var sequelize = new Sequelize('dbname', 'root', 'pass', {
port: 999,
connectionOptions: {
dialectOptions: {
supportBigNumbers: true,
bigNumberStrings: true
}
......@@ -114,8 +114,8 @@ describe(Support.getTestDialectTeaser("Configuration"), function() {
expect(config.username).to.equal('root')
expect(config.password).to.equal('pass')
expect(config.port).to.equal(999)
expect(config.connectionOptions.supportBigNumbers).to.be.true
expect(config.connectionOptions.bigNumberStrings).to.be.true
expect(config.dialectOptions.supportBigNumbers).to.be.true
expect(config.dialectOptions.bigNumberStrings).to.be.true
done()
})
})
......
......@@ -32,11 +32,11 @@ var Support = {
options.pool = options.pool || config.pool
var sequelizeOptions = {
logging: options.logging,
dialect: options.dialect,
port: options.port || process.env.SEQ_PORT || config[options.dialect].port,
pool: options.pool,
connectionOptions: options.connectionOptions || {}
logging: options.logging,
dialect: options.dialect,
port: options.port || process.env.SEQ_PORT || config[options.dialect].port,
pool: options.pool,
dialectOptions: options.dialectOptions || {}
}
if (!!options.host) {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!