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 38add415
authored
Aug 22, 2013
by
Daniel Durante
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' into milestones/2.0.0
2 parents
2edb6113
6b5e1b23
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
6 deletions
lib/dialects/postgres/connector-manager.js
test/dao-factory.test.js
lib/dialects/postgres/connector-manager.js
View file @
38add41
...
@@ -89,6 +89,7 @@ module.exports = (function() {
...
@@ -89,6 +89,7 @@ module.exports = (function() {
if
(
!!
err
)
{
if
(
!!
err
)
{
// release the pool immediately, very important.
// release the pool immediately, very important.
done
&&
done
(
err
)
done
&&
done
(
err
)
self
.
client
=
null
if
(
err
.
code
)
{
if
(
err
.
code
)
{
switch
(
err
.
code
)
{
switch
(
err
.
code
)
{
...
@@ -122,8 +123,8 @@ module.exports = (function() {
...
@@ -122,8 +123,8 @@ module.exports = (function() {
this
.
poolIdentifier
=
this
.
pg
.
pools
.
getOrCreate
(
uri
)
this
.
poolIdentifier
=
this
.
pg
.
pools
.
getOrCreate
(
uri
)
this
.
poolIdentifier
.
connect
(
connectCallback
)
this
.
poolIdentifier
.
connect
(
connectCallback
)
}
else
{
}
else
{
if
(
!!
this
.
client
)
{
if
(
!!
this
.
client
&&
this
.
client
.
readyForQuery
===
true
)
{
connectCallback
(
null
,
this
.
client
)
;
connectCallback
(
null
,
this
.
client
)
}
else
{
}
else
{
//create one-off client
//create one-off client
this
.
client
=
new
this
.
pg
.
Client
(
uri
)
this
.
client
=
new
this
.
pg
.
Client
(
uri
)
...
...
test/dao-factory.test.js
View file @
38add41
...
@@ -709,10 +709,10 @@ describe(Support.getTestDialectTeaser("DAOFactory"), function () {
...
@@ -709,10 +709,10 @@ describe(Support.getTestDialectTeaser("DAOFactory"), function () {
this
.
User
.
bulkCreate
(
data
).
success
(
function
()
{
this
.
User
.
bulkCreate
(
data
).
success
(
function
()
{
self
.
User
.
findAll
({
order
:
'id'
}).
success
(
function
(
users
)
{
self
.
User
.
findAll
({
order
:
'id'
}).
success
(
function
(
users
)
{
expect
(
users
.
length
).
to
.
equal
(
2
)
expect
(
users
.
length
).
to
.
equal
(
2
)
expect
(
users
[
0
].
username
).
to
.
equal
(
"Peter"
)
expect
(
users
[
0
].
username
).
to
.
equal
(
'Peter'
)
expect
(
parseInt
(
+
users
[
0
].
createdAt
/
5000
,
10
)).
to
.
equal
(
parseInt
(
+
new
Date
()
/
5000
,
10
)
)
expect
(
parseInt
(
+
users
[
0
].
createdAt
/
5000
,
10
)).
to
.
be
.
closeTo
(
parseInt
(
+
new
Date
()
/
5000
,
10
),
1.5
)
expect
(
users
[
1
].
username
).
to
.
equal
(
"Paul"
)
expect
(
users
[
1
].
username
).
to
.
equal
(
'Paul'
)
expect
(
parseInt
(
+
users
[
1
].
createdAt
/
5000
,
10
)).
to
.
equal
(
parseInt
(
+
new
Date
()
/
5000
,
10
)
)
expect
(
parseInt
(
+
users
[
1
].
createdAt
/
5000
,
10
)).
to
.
be
.
closeTo
(
parseInt
(
+
new
Date
()
/
5000
,
10
),
1.5
)
done
()
done
()
})
})
})
})
...
...
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