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 1083d7eb
authored
Jul 06, 2013
by
Daniel Durante
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #751 from janmeier/master
Fix for problems with quoteidentifiers
2 parents
e80cf3a1
16faae84
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
1 deletions
lib/dialects/postgres/query.js
spec/sequelize.spec.js
lib/dialects/postgres/query.js
View file @
1083d7e
...
...
@@ -111,7 +111,7 @@ module.exports = (function() {
}
else
{
// Postgres will treat tables as case-insensitive, so fix the case
// of the returned values to match attributes
if
(
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
},
{})
rows
.
forEach
(
function
(
row
)
{
Utils
.
_
.
keys
(
row
).
forEach
(
function
(
key
)
{
...
...
spec/sequelize.spec.js
View file @
1083d7e
...
...
@@ -91,6 +91,22 @@ describe(Helpers.getTestDialectTeaser("Sequelize"), function() {
}.
bind
(
this
))
})
it
(
'executes select queries correctly when quoteIdentifiers is false'
,
function
(
done
)
{
this
.
sequelize
.
options
.
quoteIdentifiers
=
false
this
.
sequelize
.
query
(
this
.
insertQuery
).
success
(
function
()
{
this
.
sequelize
.
query
(
"select * from "
+
qq
(
this
.
User
.
tableName
)
+
""
)
.
complete
(
function
(
err
,
users
)
{
if
(
err
)
{
console
.
log
(
err
)
}
expect
(
err
).
toBeNull
()
expect
(
users
.
map
(
function
(
u
){
return
u
.
username
})).
toEqual
([
'john'
])
done
()
})
}.
bind
(
this
))
})
it
(
'executes select query and parses dot notation results'
,
function
(
done
)
{
this
.
sequelize
.
query
(
this
.
insertQuery
).
success
(
function
()
{
this
.
sequelize
...
...
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