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

Commit bd2e3b20 by Sascha Depold

Merge branch 'milestones/2.0.0' of github.com:sequelize/sequelize into milestones/2.0.0

2 parents 7bd3a064 47b81bcb
[submodule "test/binary/bats"]
path = test/binary/bats
url = https://github.com/sstephenson/bats.git
......@@ -4,6 +4,7 @@ before_script:
script:
- "make test"
- "make binary"
notifications:
email:
......
......@@ -26,6 +26,8 @@ postgres:
@DIALECT=postgres make test
postgres-native:
@DIALECT=postgres-native make test
binary:
@./test/binary/test.bats
# test aliases
......@@ -34,6 +36,6 @@ postgresn: postgres-native
# test all the dialects \o/
all: sqlite mysql postgres postgres-native
all: sqlite mysql postgres postgres-native binary
.PHONY: sqlite mysql postgres pgsql postgres-native postgresn all test
\ No newline at end of file
.PHONY: sqlite mysql postgres pgsql postgres-native postgresn all test binary
......@@ -72,8 +72,9 @@ module.exports = (function() {
var emitter = new (require('events').EventEmitter)()
// in case database is slow to connect, prevent orphaning the client
if (this.isConnecting && !this.pooling) {
emitter.emit('success')
// TODO: We really need some sort of queue/flush/drain mechanism
if (this.isConnecting && !this.pooling && this.client === null) {
emitter.emit('success', null)
return emitter
}
......@@ -118,7 +119,7 @@ module.exports = (function() {
if (this.pooling) {
// acquire client from pool
this.poolIdentifier = this.pg.pools.getOrCreate(this.sequelize.config)
this.poolIdentifier = this.pg.pools.getOrCreate(uri)
this.poolIdentifier.connect(connectCallback)
} else {
if (!!this.client) {
......
......@@ -711,8 +711,8 @@ module.exports = (function() {
var template = '<%= protocol %>://<%= user %>:<%= password %>@<%= host %><% if(port) { %>:<%= port %><% } %>/<%= database %>'
return Utils._.template(template)({
user: encodeURIComponent(config.username),
password: encodeURIComponent(config.password),
user: config.username,
password: config.password,
database: config.database,
host: config.host,
port: config.port,
......
Subproject commit bc72b8587183be3f973292d6bf547adf864e7f9b
#!/usr/bin/env test/binary/bats/bin/bats
@test "no arguments prints usage instructions" {
run bin/sequelize
[ $status -eq 0 ]
[ $(expr "${lines[0]}" : "Using environment 'development'.") -ne 0 ]
[ $(expr "${lines[1]}" : "Try \"sequelize --help\" for usage information.") -ne 0 ]
}
@test "--help prints the help" {
run bin/sequelize --help
[ $status -eq 0 ]
[ "${lines[0]}" = " Usage: sequelize [options]" ]
}
@test "-h prints the help" {
run bin/sequelize -h
[ $status -eq 0 ]
[ "${lines[0]}" = " Usage: sequelize [options]" ]
}
@test "--version prints the current version" {
run bin/sequelize --version
[ $status -eq 0 ]
[ "${lines[0]}" = `cat package.json|grep version|cut -f2 -d:|cut -f2 -d\"` ]
}
@test "-V prints the current version" {
run bin/sequelize -V
[ $status -eq 0 ]
[ "${lines[0]}" = `cat package.json|grep version|cut -f2 -d:|cut -f2 -d\"` ]
}
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!