Skip to content
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(mssql): no default returning in update #12260

Merged
merged 1 commit into from
May 17, 2020

Conversation

sushantdhiman
Copy link
Contributor

@sushantdhiman sushantdhiman commented May 17, 2020

Pull Request check-list

Please make sure to review and check all of these items:

  • Does npm run test or npm run test-DIALECT pass with this change (including linting)?
  • Does the description below contain a link to an existing issue (Closes #[issue]) or a description of the issue you are solving?
  • Have you added new tests to prevent regressions?
  • Is a documentation update included (if this change modifies existing APIs, or introduces new ones)?
  • Did you update the typescript typings accordingly (if applicable)?
  • Did you follow the commit message conventions explained in CONTRIBUTING.md?

Description of change

This is a breaking change for MSSQL. MSSQL lacks ability to return affectedRows for update operation without OUTPUT INSERTED.* statement. As this PR fixes that behavior, we are not automatically injecting that statement.

So MSSQL users if need affectedRows count from update, will need to call it with returning: true

Supports disabling OUTPUT INSERTED.* with returning: false

Closes #11203
Fixes #11304
Fixes #11201

@sushantdhiman sushantdhiman force-pushed the mssql-no-default-returning-update branch from faf4f9b to aa1ecca Compare May 17, 2020 07:53
@codecov
Copy link

codecov bot commented May 17, 2020

Codecov Report

Merging #12260 into master will decrease coverage by 0.00%.
The diff coverage is 80.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #12260      +/-   ##
==========================================
- Coverage   96.34%   96.34%   -0.01%     
==========================================
  Files          95       95              
  Lines        9128     9127       -1     
==========================================
- Hits         8794     8793       -1     
  Misses        334      334              
Impacted Files Coverage Δ
lib/model.js 96.57% <0.00%> (-0.01%) ⬇️
lib/dialects/abstract/query-generator.js 97.14% <100.00%> (ø)
lib/dialects/abstract/query-interface.js 93.59% <100.00%> (ø)
lib/dialects/mssql/query.js 95.65% <100.00%> (ø)
lib/instance-validator.js 97.54% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 18dcc7e...aa1ecca. Read the comment docs.

@sushantdhiman sushantdhiman merged commit daeb0f7 into master May 17, 2020
@sushantdhiman sushantdhiman deleted the mssql-no-default-returning-update branch May 17, 2020 08:05
ShaharHD added a commit to ShaharHD/sequelize that referenced this pull request Jun 23, 2020
Reference for change is based on sequelize#12260

- use rowCount intead of data.length when not returning data
ShaharHD added a commit to ShaharHD/sequelize that referenced this pull request Jun 25, 2020
Reference for change is based on sequelize#12260

- use rowCount intead of data.length when not returning data
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

returning is ignored for MSSQL update MSSQL Update from Model with trigger OUTPUT clause without INTO clause
1 participant