sequelize icon indicating copy to clipboard operation
sequelize copied to clipboard

BeforeBulkUpdate hook for increment/decrement

Open iamoskvin opened this issue 1 year ago • 0 comments

Feature Description

Describe the feature you'd like to see implemented

Right now beforeBulkUpdate hook is called for Model.update but not for Model.increment/decrement. It would be useful to call the hook in case of these methods too.

Describe why you would like this feature to be added to Sequelize

My case. I need to use this hook to populate the tenant_id field of my model. It is more convenient to set a value in a model hook and not to set a value manually in different pieces of code. I don't see a problem here with atomic update.

Is this feature dialect-specific?

  • [ ] No. This feature is relevant to Sequelize as a whole.

Would you be willing to resolve this issue by submitting a Pull Request?

  • [ ] No, I don't have the time, and I understand that I will need to wait until someone from the community or maintainers is interested in implementing my feature.

Indicate your interest in the addition of this feature by adding the 👍 reaction. Comments such as "+1" will be removed.

iamoskvin avatar Oct 15 '23 22:10 iamoskvin