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

Support for Mikro-ORM #164

Open
vroudge opened this issue Jul 11, 2024 · 2 comments
Open

Support for Mikro-ORM #164

vroudge opened this issue Jul 11, 2024 · 2 comments
Labels
contribution welcome This is a good candidate for a community contribution enhancement New feature or request

Comments

@vroudge
Copy link

vroudge commented Jul 11, 2024

Seeing as Mikro-orm is an unit-of-work-first ORM, I think it would be great to see a plugin for it for nestjs-cls.

It would be particularly relevant as it uses itself transactional contexts through async_hooks to deal with persisting transactions accross different contexts.

@Papooch Papooch added the enhancement New feature or request label Jul 11, 2024
@Papooch
Copy link
Owner

Papooch commented Jul 11, 2024

I looked at MikroORM, but couldn't figure out how to make it work together with their notion of entity managers.

All other adapters work by having access to a single underlying connection object that they can use to start the transaction. With MikroORM, the transaction decorator would somehow need to get ahold of the current entity manager instance even if no transaction is in progress.

However, it is still in my back-log, so maybe I'll figure it out eventually - maybe the adapter abstraction would need to be refactored a bit to support MikroORM. I would definitely appreciate some help in that regard.

@Papooch Papooch added the contribution welcome This is a good candidate for a community contribution label Sep 11, 2024
@Papooch
Copy link
Owner

Papooch commented Nov 18, 2024

Is this adapter still needed? MikroORM now comes with their own @Transactional decorator.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
contribution welcome This is a good candidate for a community contribution enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants