-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: fix #260 UPDATE with LIMIT and ORDER should be formatted(mysql only) #261
Conversation
Codecov Report
@@ Coverage Diff @@
## master #261 +/- ##
=======================================
Coverage 97.32% 97.33%
=======================================
Files 44 44
Lines 3144 3155 +11
=======================================
+ Hits 3060 3071 +11
Misses 84 84
Continue to review full report at Codecov.
|
const extraOptions = this.formatUpdateExtraOptions(spell); | ||
if (extraOptions.length) { | ||
chunks.push(...extraOptions); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This bug fix shouldn't be sequelize adapter specific I think. Use cases like below should be supported as well:
Post.update({ title: null }, { title: 'Untitled' }).order('id', 'desc').limit(10);
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This bug fix shouldn't be sequelize adapter specific I think. Use cases like below should be supported as well:
Post.update({ title: null }, { title: 'Untitled' }).order('id', 'desc').limit(10);
It's a MySQL only feature, this was supported at this PR, see
test/integration/suite/basics.test.js:685
test/unit/spell.test.js:638
@@ -682,6 +682,21 @@ describe('=> Basic', () => { | |||
expect(posts.length).to.equal(affectedRows); | |||
}); | |||
|
|||
it('Bone.update(where, values) should work with limit/offset and order', async function() { | |||
if (Post.driver.type === 'mysql') { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mysql only
attr