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 9f6c5f04
authored
Sep 25, 2014
by
Joel Trost
Committed by
Matt Broadstone
Dec 09, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Partial fix for where clause, still issues
1 parent
c9ace4d8
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
7 deletions
lib/dialects/mssql/query-generator.js
lib/dialects/mssql/query-generator.js
View file @
9f6c5f0
...
@@ -159,8 +159,14 @@ module.exports = (function() {
...
@@ -159,8 +159,14 @@ module.exports = (function() {
OR a string with conditions (e.g. 'name="foo"').
OR a string with conditions (e.g. 'name="foo"').
If you use a string, you have to escape it on your own.
If you use a string, you have to escape it on your own.
*/
*/
updateQuery
:
function
(
tableName
,
attrValueHash
,
where
,
options
,
attributes
)
{
updateQuery
:
function
(
tableName
,
attrValueHash
,
where
,
options
,
attributes
)
{
throwMethodUndefined
(
'updateQuery'
);
console
.
log
(
where
);
var
query
=
[
SqlGenerator
.
updateSql
(
tableName
,
attrValueHash
,
attributes
),
this
.
getWhereConditions
(
where
)
].
join
(
' '
)
+
';'
;
console
.
log
(
query
);
return
query
;
},
},
/*
/*
Returns a deletion query.
Returns a deletion query.
...
@@ -399,7 +405,7 @@ module.exports = (function() {
...
@@ -399,7 +405,7 @@ module.exports = (function() {
if
(
options
.
hasOwnProperty
(
'where'
)){
if
(
options
.
hasOwnProperty
(
'where'
)){
query
.
push
(
this
.
getWhereConditions
(
options
.
where
,
model
.
name
,
model
,
options
));
query
.
push
(
this
.
getWhereConditions
(
options
.
where
,
model
.
name
,
model
,
options
));
}
}
//console.log(query);
//console.log(query
.join(' ') + ';'
);
return
query
.
join
(
' '
)
+
';'
;
return
query
.
join
(
' '
)
+
';'
;
},
},
/**
/**
...
@@ -489,12 +495,12 @@ module.exports = (function() {
...
@@ -489,12 +495,12 @@ module.exports = (function() {
/*
/*
Takes something and transforms it into values of a where condition.
Takes something and transforms it into values of a where condition.
*/
*/
getWhereConditions
:
function
(
smth
,
tableName
,
model
,
options
,
prepend
)
{
getWhereConditions
:
function
(
where
,
tableName
,
model
,
options
,
prepend
)
{
//console.log('where:', model);
//console.log('where:', model);
//console.log('logic', smth
);
console
.
log
(
'logic'
,
where
);
if
(
!
smth
){
if
(
where
){
return
SqlGenerator
.
getWhereClause
(
tableName
,
model
,
options
);
return
SqlGenerator
.
getWhereClause
(
where
,
tableName
);
}
else
{
}
else
{
return
''
;
return
''
;
}
}
...
...
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