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

Commit bce34621 by Mick Hansen

Merge pull request #1632 from sangpire/master

Support postgreSQL 'postgresql://' scheme.
2 parents ea399fca f3efb307
Showing with 16 additions and 0 deletions
......@@ -97,6 +97,10 @@ module.exports = (function() {
language: 'en'
}, options || {})
if (this.options.dialect === 'postgresql') {
this.options.dialect = 'postgres'
}
if (this.options.logging === true) {
console.log('DEPRECATION WARNING: The logging-option should be either a function or false. Default: console.log')
this.options.logging = console.log
......
......@@ -52,6 +52,18 @@ describe(Support.getTestDialectTeaser("Sequelize"), function () {
var sequelize = new Sequelize('sqlite://test.sqlite/lol?reconnect=true')
})
}
if (dialect === 'postgres') {
var getConnectionUri = _.template('<%= protocol %>://<%= username %>:<%= password %>@<%= host %><% if(port) { %>:<%= port %><% } %>/<%= database %>')
it('should work with connection strings (postgres protocol)', function () {
var connectionUri = getConnectionUri(_.extend(config[dialect], {protocol: 'postgres'}))
var sequelize = new Sequelize(connectionUri) // postgres://...
})
it('should work with connection strings (postgresql protocol)', function () {
var connectionUri = getConnectionUri(_.extend(config[dialect], {protocol: 'postgresql'}))
var sequelize = new Sequelize(connectionUri) // postgresql://...
})
}
})
if (dialect !== 'sqlite') {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!