Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
public
/
sequelize
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
不要怂,就是干,撸起袖子干!
Commit bd2e3b20
authored
Aug 17, 2013
by
Sascha Depold
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'milestones/2.0.0' of github.com:sequelize/sequelize into milestones/2.0.0
2 parents
7bd3a064
47b81bcb
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
50 additions
and
8 deletions
.gitmodules
.travis.yml
Makefile
lib/dialects/postgres/connector-manager.js
lib/dialects/postgres/query-generator.js
test/binary/bats
test/binary/test.bats
.gitmodules
View file @
bd2e3b2
[submodule "test/binary/bats"]
path = test/binary/bats
url = https://github.com/sstephenson/bats.git
.travis.yml
View file @
bd2e3b2
...
@@ -4,6 +4,7 @@ before_script:
...
@@ -4,6 +4,7 @@ before_script:
script
:
script
:
-
"
make
test"
-
"
make
test"
-
"
make
binary"
notifications
:
notifications
:
email
:
email
:
...
...
Makefile
View file @
bd2e3b2
...
@@ -26,6 +26,8 @@ postgres:
...
@@ -26,6 +26,8 @@ postgres:
@
DIALECT
=
postgres make
test
@
DIALECT
=
postgres make
test
postgres-native
:
postgres-native
:
@
DIALECT
=
postgres-native make
test
@
DIALECT
=
postgres-native make
test
binary
:
@
./test/binary/test.bats
# test aliases
# test aliases
...
@@ -34,6 +36,6 @@ postgresn: postgres-native
...
@@ -34,6 +36,6 @@ postgresn: postgres-native
# test all the dialects \o/
# 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
.PHONY
:
sqlite mysql postgres pgsql postgres-native postgresn all test binary
\ No newline at end of file
lib/dialects/postgres/connector-manager.js
View file @
bd2e3b2
...
@@ -72,8 +72,9 @@ module.exports = (function() {
...
@@ -72,8 +72,9 @@ module.exports = (function() {
var
emitter
=
new
(
require
(
'events'
).
EventEmitter
)()
var
emitter
=
new
(
require
(
'events'
).
EventEmitter
)()
// in case database is slow to connect, prevent orphaning the client
// in case database is slow to connect, prevent orphaning the client
if
(
this
.
isConnecting
&&
!
this
.
pooling
)
{
// TODO: We really need some sort of queue/flush/drain mechanism
emitter
.
emit
(
'success'
)
if
(
this
.
isConnecting
&&
!
this
.
pooling
&&
this
.
client
===
null
)
{
emitter
.
emit
(
'success'
,
null
)
return
emitter
return
emitter
}
}
...
@@ -118,7 +119,7 @@ module.exports = (function() {
...
@@ -118,7 +119,7 @@ module.exports = (function() {
if
(
this
.
pooling
)
{
if
(
this
.
pooling
)
{
// acquire client from pool
// acquire client from pool
this
.
poolIdentifier
=
this
.
pg
.
pools
.
getOrCreate
(
this
.
sequelize
.
config
)
this
.
poolIdentifier
=
this
.
pg
.
pools
.
getOrCreate
(
uri
)
this
.
poolIdentifier
.
connect
(
connectCallback
)
this
.
poolIdentifier
.
connect
(
connectCallback
)
}
else
{
}
else
{
if
(
!!
this
.
client
)
{
if
(
!!
this
.
client
)
{
...
...
lib/dialects/postgres/query-generator.js
View file @
bd2e3b2
...
@@ -711,8 +711,8 @@ module.exports = (function() {
...
@@ -711,8 +711,8 @@ module.exports = (function() {
var
template
=
'<%= protocol %>://<%= user %>:<%= password %>@<%= host %><% if(port) { %>:<%= port %><% } %>/<%= database %>'
var
template
=
'<%= protocol %>://<%= user %>:<%= password %>@<%= host %><% if(port) { %>:<%= port %><% } %>/<%= database %>'
return
Utils
.
_
.
template
(
template
)({
return
Utils
.
_
.
template
(
template
)({
user
:
encodeURIComponent
(
config
.
username
)
,
user
:
config
.
username
,
password
:
encodeURIComponent
(
config
.
password
)
,
password
:
config
.
password
,
database
:
config
.
database
,
database
:
config
.
database
,
host
:
config
.
host
,
host
:
config
.
host
,
port
:
config
.
port
,
port
:
config
.
port
,
...
...
bats
@
bc72b858
Subproject commit bc72b8587183be3f973292d6bf547adf864e7f9b
test/binary/test.bats
0 → 100755
View file @
bd2e3b2
#!/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\"` ]
}
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment