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 540d965d
authored
Mar 27, 2014
by
Nuno Sousa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add missing space to if statements
1 parent
6fa22d6f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
lib/dialects/postgres/query.js
lib/dialects/postgres/query.js
View file @
540d965
...
@@ -115,12 +115,12 @@ module.exports = (function() {
...
@@ -115,12 +115,12 @@ module.exports = (function() {
}
else
{
}
else
{
// Postgres will treat tables as case-insensitive, so fix the case
// Postgres will treat tables as case-insensitive, so fix the case
// of the returned values to match attributes
// of the returned values to match attributes
if
(
this
.
options
.
raw
===
false
&&
this
.
sequelize
.
options
.
quoteIdentifiers
===
false
)
{
if
(
this
.
options
.
raw
===
false
&&
this
.
sequelize
.
options
.
quoteIdentifiers
===
false
)
{
var
attrsMap
=
Utils
.
_
.
reduce
(
this
.
callee
.
attributes
,
function
(
m
,
v
,
k
)
{
m
[
k
.
toLowerCase
()]
=
k
;
return
m
},
{})
var
attrsMap
=
Utils
.
_
.
reduce
(
this
.
callee
.
attributes
,
function
(
m
,
v
,
k
)
{
m
[
k
.
toLowerCase
()]
=
k
;
return
m
},
{})
rows
.
forEach
(
function
(
row
)
{
rows
.
forEach
(
function
(
row
)
{
Utils
.
_
.
keys
(
row
).
forEach
(
function
(
key
)
{
Utils
.
_
.
keys
(
row
).
forEach
(
function
(
key
)
{
var
targetAttr
=
attrsMap
[
key
]
var
targetAttr
=
attrsMap
[
key
]
if
(
targetAttr
!=
key
)
{
if
(
targetAttr
!=
key
)
{
row
[
targetAttr
]
=
row
[
key
]
row
[
targetAttr
]
=
row
[
key
]
delete
row
[
key
]
delete
row
[
key
]
}
}
...
@@ -141,7 +141,7 @@ module.exports = (function() {
...
@@ -141,7 +141,7 @@ module.exports = (function() {
}
else
if
(
this
.
send
(
'isShowOrDescribeQuery'
))
{
}
else
if
(
this
.
send
(
'isShowOrDescribeQuery'
))
{
this
.
emit
(
'success'
,
results
)
this
.
emit
(
'success'
,
results
)
}
else
if
(
this
.
send
(
'isInsertQuery'
))
{
}
else
if
(
this
.
send
(
'isInsertQuery'
))
{
if
(
this
.
callee
!==
null
)
{
// may happen for bulk inserts
if
(
this
.
callee
!==
null
)
{
// may happen for bulk inserts
for
(
var
key
in
rows
[
0
])
{
for
(
var
key
in
rows
[
0
])
{
if
(
rows
[
0
].
hasOwnProperty
(
key
))
{
if
(
rows
[
0
].
hasOwnProperty
(
key
))
{
var
record
=
rows
[
0
][
key
]
var
record
=
rows
[
0
][
key
]
...
@@ -156,7 +156,7 @@ module.exports = (function() {
...
@@ -156,7 +156,7 @@ module.exports = (function() {
}
else
if
([
QueryTypes
.
BULKUPDATE
,
QueryTypes
.
BULKDELETE
].
indexOf
(
this
.
options
.
type
)
!==
-
1
)
{
}
else
if
([
QueryTypes
.
BULKUPDATE
,
QueryTypes
.
BULKDELETE
].
indexOf
(
this
.
options
.
type
)
!==
-
1
)
{
this
.
emit
(
'success'
,
result
.
rowCount
)
this
.
emit
(
'success'
,
result
.
rowCount
)
}
else
if
(
this
.
send
(
'isUpdateQuery'
))
{
}
else
if
(
this
.
send
(
'isUpdateQuery'
))
{
if
(
this
.
callee
!==
null
)
{
// may happen for bulk updates
if
(
this
.
callee
!==
null
)
{
// may happen for bulk updates
for
(
var
key
in
rows
[
0
])
{
for
(
var
key
in
rows
[
0
])
{
if
(
rows
[
0
].
hasOwnProperty
(
key
))
{
if
(
rows
[
0
].
hasOwnProperty
(
key
))
{
var
record
=
rows
[
0
][
key
]
var
record
=
rows
[
0
][
key
]
...
...
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