Example for using @InjectRepository in TypeORM
#330
-
|
I only saw an example with a custom repository, is it possible to use it with @InjectRespository too or do I have to do something to make it work? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
|
Unfortunately, it is not possible to make it work with There is a disclaimer right at the top of the docs page of the adapter: https://papooch.github.io/nestjs-cls/plugins/available-plugins/transactional/typeorm-adapter You can alternatively use the |
Beta Was this translation helpful? Give feedback.
Unfortunately, it is not possible to make it work with
InjectRepository, as that would require monkey-patching.There is a disclaimer right at the top of the docs page of the adapter: https://papooch.github.io/nestjs-cls/plugins/available-plugins/transactional/typeorm-adapter
You can alternatively use the
typeorm-transactionalpackage, which implements a similar API through monkey-patching of TypeORM.