Add method for accessing #transactionCls Sequelize v7 #17310
Labels
pending-approval
Bug reports that have not been verified yet, or feature requests that have not been accepted yet
type: feature
For issues and PRs. For new features. Never breaking changes.
Issue Creation Checklist
Feature Description
Describe the feature you'd like to see implemented
I would like to get a way of accessing the
#transactionCls
property ofSequelize
.Describe why you would like this feature to be added to Sequelize
Right now, I find myself switching from Sequelize v6 to v7, due to their better handling of async errors. The only problem I found myself on is that, as now the method
Sequelize.useCLS
doesn't exist anymore, I'm not able to run unmanaged transactions with CLS.I understand that this is wanted, as stated in the documentation, but I don't understand why, as this feature allows great flexibility to the ORM.
My personal use for it is when creating a middleware with ExpressJs for having a transaction enclose each request, and I haven't found the way to correctly implement this with managed transactions. With unmanaged transactions it is perfectly makeable, but in this new version I have to manually set the transaction on each query, which is not ideal.
Is this feature dialect-specific?
Would you be willing to resolve this issue by submitting a Pull Request?
Indicate your interest in the addition of this feature by adding the 👍 reaction. Comments such as "+1" will be removed.
The text was updated successfully, but these errors were encountered: