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

Add method for accessing #transactionCls Sequelize v7 #17310

Open
4 of 8 tasks
nachobascar opened this issue May 5, 2024 · 0 comments
Open
4 of 8 tasks

Add method for accessing #transactionCls Sequelize v7 #17310

nachobascar opened this issue May 5, 2024 · 0 comments
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.

Comments

@nachobascar
Copy link

Issue Creation Checklist

  • I understand that my issue will be automatically closed if I don't fill in the requested information
  • I have read the contribution guidelines

Feature Description

Describe the feature you'd like to see implemented

I would like to get a way of accessing the #transactionCls property of Sequelize.

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?

  • No. This feature is relevant to Sequelize as a whole.
  • Yes. This feature only applies to the following dialect(s):

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

  • Yes, I have the time and I know how to start.
  • Yes, I have the time but I will need guidance.
  • No, I don't have the time, but my company or I are supporting Sequelize through donations on OpenCollective.
  • 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.

@nachobascar nachobascar added 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. labels May 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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.
Projects
None yet
Development

No branches or pull requests

1 participant