Skip to content

Conversation

@petersg83
Copy link
Contributor

@petersg83 petersg83 commented May 18, 2022

  • Use transactions for some actions (update folder location + bulk move)
  • Add transaction implementation to the queryBuilder

@petersg83 petersg83 force-pushed the ML-folder/transactions branch 3 times, most recently from 5815c3a to ff380f9 Compare May 20, 2022 17:25
@petersg83 petersg83 marked this pull request as ready for review May 20, 2022 17:26
@codecov
Copy link

codecov bot commented May 20, 2022

Codecov Report

Merging #13350 (71f43f0) into features/ML-folder (5e02bd6) will decrease coverage by 0.15%.
The diff coverage is 0.00%.

@@                  Coverage Diff                   @@
##           features/ML-folder   #13350      +/-   ##
======================================================
- Coverage               47.80%   47.64%   -0.16%     
======================================================
  Files                     234      234              
  Lines                    8717     8746      +29     
  Branches                 1947     1951       +4     
======================================================
  Hits                     4167     4167              
- Misses                   3745     3771      +26     
- Partials                  805      808       +3     
Flag Coverage Δ
unit 47.64% <0.00%> (-0.16%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
.../content-manager/server/services/entity-manager.js 31.53% <0.00%> (ø)
packages/core/database/lib/entity-manager.js 3.81% <ø> (ø)
packages/core/database/lib/index.js 29.26% <0.00%> (-1.51%) ⬇️
packages/core/database/lib/query/query-builder.js 2.01% <0.00%> (-0.11%) ⬇️
...s/core/strapi/lib/services/entity-service/index.js 40.74% <0.00%> (ø)
packages/core/upload/server/services/folder.js 22.89% <0.00%> (-5.90%) ⬇️

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 c105fd8...71f43f0. Read the comment docs.

@petersg83 petersg83 force-pushed the ML-folder/transactions branch from ff380f9 to 71f43f0 Compare May 23, 2022 12:31
const existingFolders = await strapi.db
.queryBuilder(FOLDER_MODEL_UID)
.select(['id', 'uid', 'path'])
.where({ id: { $in: folderIds } })
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note: if you do id: folderIds the $in will be implicit :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice, good to know thanks :)

@alexandrebodin alexandrebodin self-assigned this May 31, 2022
@petersg83 petersg83 requested a review from alexandrebodin May 31, 2022 14:40
@petersg83 petersg83 merged commit a9f53dc into features/ML-folder May 31, 2022
@petersg83 petersg83 deleted the ML-folder/transactions branch May 31, 2022 16:58
@strapi-bot
Copy link

This pull request has been mentioned on Strapi Community Forum. There might be relevant details there:

https://forum.strapi.io/t/strapi-v4-isnt-acid-compliant-and-doesnt-natively-support-transactions/21312/1

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.

4 participants