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 3a61c6e8
authored
Aug 17, 2015
by
Ivan Postic
Committed by
Jan Aagaard Meier
Aug 18, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(increment) use QueryTypes.UPDATE instead of RAW when incrementing a value of an instance
1 parent
6eeff418
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
1 deletions
lib/query-interface.js
test/integration/instance.test.js
lib/query-interface.js
View file @
3a61c6e
...
@@ -681,7 +681,7 @@ QueryInterface.prototype.increment = function(instance, tableName, values, ident
...
@@ -681,7 +681,7 @@ QueryInterface.prototype.increment = function(instance, tableName, values, ident
options
=
options
||
{};
options
=
options
||
{};
options
.
type
=
QueryTypes
.
RAW
;
options
.
type
=
QueryTypes
.
UPDATE
;
options
.
instance
=
instance
;
options
.
instance
=
instance
;
return
this
.
sequelize
.
query
(
sql
,
options
);
return
this
.
sequelize
.
query
(
sql
,
options
);
};
};
...
...
test/integration/instance.test.js
View file @
3a61c6e
...
@@ -140,6 +140,16 @@ describe(Support.getTestDialectTeaser('Instance'), function() {
...
@@ -140,6 +140,16 @@ describe(Support.getTestDialectTeaser('Instance'), function() {
});
});
}
}
if
(
current
.
dialect
.
supports
.
returnValues
.
returning
)
{
it
(
'supports returning'
,
function
()
{
return
this
.
User
.
findById
(
1
).
then
(
function
(
user1
)
{
return
user1
.
increment
(
'aNumber'
,
{
by
:
2
}).
then
(
function
()
{
expect
(
user1
.
aNumber
).
to
.
be
.
equal
(
2
);
});
});
});
}
it
(
'supports where conditions'
,
function
()
{
it
(
'supports where conditions'
,
function
()
{
var
self
=
this
;
var
self
=
this
;
return
this
.
User
.
findById
(
1
).
then
(
function
(
user1
)
{
return
this
.
User
.
findById
(
1
).
then
(
function
(
user1
)
{
...
...
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