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

Commit 7199ff80 by Daniel Durante

Default ports are now declared in the ConnectorManager.

1 parent 6a36ca11
...@@ -12,6 +12,7 @@ module.exports = (function() { ...@@ -12,6 +12,7 @@ module.exports = (function() {
this.sequelize = sequelize this.sequelize = sequelize
this.client = null this.client = null
this.config = config || {} this.config = config || {}
this.config.port = this.config.port || 3306
this.disconnectTimeoutId = null this.disconnectTimeoutId = null
this.queue = [] this.queue = []
this.activeQueue = [] this.activeQueue = []
......
...@@ -4,10 +4,11 @@ var Query = require("./query") ...@@ -4,10 +4,11 @@ var Query = require("./query")
module.exports = (function() { module.exports = (function() {
var ConnectorManager = function(sequelize, config) { var ConnectorManager = function(sequelize, config) {
this.sequelize = sequelize this.sequelize = sequelize
this.client = null this.client = null
this.config = config || {} this.config = config || {}
this.pooling = (!!this.config.poolCfg && (this.config.poolCfg.maxConnections > 0)) this.config.port = this.config.port || 5432
this.pg = this.config.native ? require('pg').native : require('pg') this.pooling = (!!this.config.poolCfg && (this.config.poolCfg.maxConnections > 0))
this.pg = this.config.native ? require('pg').native : require('pg')
// set pooling parameters if specified // set pooling parameters if specified
if (this.pooling) { if (this.pooling) {
......
...@@ -69,7 +69,6 @@ module.exports = (function() { ...@@ -69,7 +69,6 @@ module.exports = (function() {
this.options = Utils._.extend({ this.options = Utils._.extend({
dialect: 'mysql', dialect: 'mysql',
host: 'localhost', host: 'localhost',
port: 3306,
protocol: 'tcp', protocol: 'tcp',
define: {}, define: {},
query: {}, query: {},
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!