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

Commit 52a675a5 by Sushant Committed by Jan Aagaard Meier

#5520, throw error when no dialect supplied

1 parent 730ad7ed
Showing with 5 additions and 1 deletions
...@@ -149,7 +149,7 @@ var Sequelize = function(database, username, password, options) { ...@@ -149,7 +149,7 @@ var Sequelize = function(database, username, password, options) {
Sequelize.runHooks('beforeInit', config, options); Sequelize.runHooks('beforeInit', config, options);
this.options = Utils._.extend({ this.options = Utils._.extend({
dialect: 'mysql', dialect: null,
dialectModulePath: null, dialectModulePath: null,
host: 'localhost', host: 'localhost',
protocol: 'tcp', protocol: 'tcp',
...@@ -173,6 +173,10 @@ var Sequelize = function(database, username, password, options) { ...@@ -173,6 +173,10 @@ var Sequelize = function(database, username, password, options) {
benchmark: false benchmark: false
}, options || {}); }, options || {});
if (!this.options.dialect) {
throw new Error('Dialect needs to be explicitly supplied as of v4.0.0');
}
if (this.options.dialect === 'postgresql') { if (this.options.dialect === 'postgresql') {
this.options.dialect = 'postgres'; this.options.dialect = 'postgres';
} }
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!