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

Commit 35e68f67 by Michael Haselton Committed by Jan Aagaard Meier

Update Postgres connect manager (browserify fix).

1 parent 328e2bb7
Showing with 7 additions and 1 deletions
...@@ -15,7 +15,13 @@ ConnectionManager = function(dialect, sequelize) { ...@@ -15,7 +15,13 @@ ConnectionManager = function(dialect, sequelize) {
this.sequelize = sequelize; this.sequelize = sequelize;
this.sequelize.config.port = this.sequelize.config.port || 5432; this.sequelize.config.port = this.sequelize.config.port || 5432;
try { try {
this.lib = sequelize.config.native ? require(sequelize.config.dialectModulePath || 'pg').native : require(sequelize.config.dialectModulePath || 'pg'); var pgLib;
if (sequelize.config.dialectModulePath) {
pgLib = require(sequelize.config.dialectModulePath);
} else {
pgLib = require('pg');
}
this.lib = sequelize.config.native ? pgLib.native : pgLib;
} catch (err) { } catch (err) {
throw new Error('Please install \'' + (sequelize.config.dialectModulePath || 'pg') + '\' module manually'); throw new Error('Please install \'' + (sequelize.config.dialectModulePath || 'pg') + '\' module manually');
} }
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!