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

Closed
vroudge opened this issue Jul 11, 2024 · 3 comments
Closed

Support for Mikro-ORM #164

vroudge opened this issue Jul 11, 2024 · 3 comments
Labels
contribution welcome This is a good candidate for a community contribution documentation Improvements or additions to documentation 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.

@Papooch Papooch added the documentation Improvements or additions to documentation label Dec 12, 2024
@Papooch
Copy link
Owner

Papooch commented Jan 9, 2025

I'll go ahead and close this as not planned, as per my previous comment, I don't see a reason to re-implement a sub-par version of the same feature that MikroORM already comes with.

If there is any need for an official adapter, please open a new issue and explain the reasoning.

@Papooch Papooch closed this as not planned Won't fix, can't repro, duplicate, stale Jan 9, 2025
@Papooch Papooch linked a pull request Jan 9, 2025 that will close this issue
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 documentation Improvements or additions to documentation enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants