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 7683f133
authored
May 18, 2013
by
Peter Braun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Updated postgres query-generator jasmine spec to
make changes in issue #629 pass.
1 parent
e03956a0
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
6 deletions
lib/dialects/postgres/query-generator.js
spec-jasmine/postgres/query-generator.spec.js
lib/dialects/postgres/query-generator.js
View file @
7683f13
...
@@ -465,7 +465,6 @@ module.exports = (function() {
...
@@ -465,7 +465,6 @@ module.exports = (function() {
result
=
QueryGenerator
.
hashToWhereConditions
(
smth
)
result
=
QueryGenerator
.
hashToWhereConditions
(
smth
)
}
}
else
if
(
typeof
smth
===
"number"
)
{
else
if
(
typeof
smth
===
"number"
)
{
smth
=
QueryGenerator
.
pgEscape
(
smth
)
smth
=
Utils
.
prependTableNameToHash
(
tableName
,
{
id
:
smth
})
smth
=
Utils
.
prependTableNameToHash
(
tableName
,
{
id
:
smth
})
result
=
QueryGenerator
.
hashToWhereConditions
(
smth
)
result
=
QueryGenerator
.
hashToWhereConditions
(
smth
)
}
}
...
...
spec-jasmine/postgres/query-generator.spec.js
View file @
7683f13
...
@@ -49,16 +49,16 @@ describe('QueryGenerator', function() {
...
@@ -49,16 +49,16 @@ describe('QueryGenerator', function() {
expectation
:
"SELECT \"id\", \"name\" FROM \"myTable\";"
expectation
:
"SELECT \"id\", \"name\" FROM \"myTable\";"
},
{
},
{
arguments
:
[
'myTable'
,
{
where
:
{
id
:
2
}}],
arguments
:
[
'myTable'
,
{
where
:
{
id
:
2
}}],
expectation
:
"SELECT * FROM \"myTable\" WHERE \"id\"=2;"
expectation
:
"SELECT * FROM \"myTable\" WHERE \"
myTable\".\"
id\"=2;"
},
{
},
{
arguments
:
[
'myTable'
,
{
where
:
{
name
:
'foo'
}}],
arguments
:
[
'myTable'
,
{
where
:
{
name
:
'foo'
}}],
expectation
:
"SELECT * FROM \"myTable\" WHERE \"name\"='foo';"
expectation
:
"SELECT * FROM \"myTable\" WHERE \"
myTable\".\"
name\"='foo';"
},
{
},
{
arguments
:
[
'myTable'
,
{
where
:
{
name
:
"foo';DROP TABLE myTable;"
}}],
arguments
:
[
'myTable'
,
{
where
:
{
name
:
"foo';DROP TABLE myTable;"
}}],
expectation
:
"SELECT * FROM \"myTable\" WHERE \"name\"='foo'';DROP TABLE myTable;';"
expectation
:
"SELECT * FROM \"myTable\" WHERE \"
myTable\".\"
name\"='foo'';DROP TABLE myTable;';"
},
{
},
{
arguments
:
[
'myTable'
,
{
where
:
2
}],
arguments
:
[
'myTable'
,
{
where
:
2
}],
expectation
:
"SELECT * FROM \"myTable\" WHERE \"id\"=2;"
expectation
:
"SELECT * FROM \"myTable\" WHERE \"
myTable\".\"
id\"=2;"
},
{
},
{
arguments
:
[
'foo'
,
{
attributes
:
[[
'count(*)'
,
'count'
]]
}],
arguments
:
[
'foo'
,
{
attributes
:
[[
'count(*)'
,
'count'
]]
}],
expectation
:
'SELECT count(*) as \"count\" FROM \"foo\";'
expectation
:
'SELECT count(*) as \"count\" FROM \"foo\";'
...
@@ -92,7 +92,7 @@ describe('QueryGenerator', function() {
...
@@ -92,7 +92,7 @@ describe('QueryGenerator', function() {
expectation
:
"SELECT * FROM \"mySchema\".\"myTable\";"
expectation
:
"SELECT * FROM \"mySchema\".\"myTable\";"
},
{
},
{
arguments
:
[
'mySchema.myTable'
,
{
where
:
{
name
:
"foo';DROP TABLE mySchema.myTable;"
}}],
arguments
:
[
'mySchema.myTable'
,
{
where
:
{
name
:
"foo';DROP TABLE mySchema.myTable;"
}}],
expectation
:
"SELECT * FROM \"mySchema\".\"myTable\" WHERE \"name\"='foo'';DROP TABLE mySchema.myTable;';"
expectation
:
"SELECT * FROM \"mySchema\".\"myTable\" WHERE \"
mySchema\".\"myTable\".\"
name\"='foo'';DROP TABLE mySchema.myTable;';"
}
}
],
],
...
...
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