sequelize / sequelize/sequelize
BeforeBulkUpdate hook for increment/decrement
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 30.4k
- Forks
- 4.3k
- Avg merge
- 1d 6h
- Merged PRs (30d)
- 68
Description
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.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing the beforeBulkUpdate hook entry point and the Model.increment/decrement methods described in the issue. Confirm how Model.update invokes the hook, then add equivalent behavior for increment and decrement and verify that the hook runs while preserving atomic updates.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- nodejs, typescript
- Domain
- backend, database
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100