feat: add Transactional Decorator #6183
Labels
enhancement
New feature or request
good first issue
Good for newcomers
help wanted
Extra attention is needed
Is your feature request related to a problem? Please describe.
Hey, this is amazing ORM to NestJS and I am migrating from TypeOrm, but I am passing by a problem.
In TypeOrm have a lib typeorm-transactional that add a
@Transactional
, like a Spring Framework, to create transaction in database with decorator. And this do more easy work with transaction, e.g:If any error occur inside
saveUser
method orRoleService
, a rollback is executed, otherwise a commit is executed whensaveUser
finalize.And don't need inject
EntityManager
and callem.begin()
orem.transactional()
. In addition, don't need checked if exist a transactional open because@Transactional()
manage this. See Propagation and IsolationDescribe the solution you'd like
The same solution of Spring
@Transactional
that typeorm-transactional usesDescribe alternatives you've considered
Using
AsyncLocalStorage
of node to manage a context of mikro-orm and open a transaction liketypeorm-transactional
Additional context
...
The text was updated successfully, but these errors were encountered: