Search code examples
mysqltypescripttreenestjstypeorm

Inject Tree Typeorm Repository in Nestjs


is it possible to inject Tree Typeorm repository into Nestjs?

I didn't find anything online or in the sources that would help me here.

Or would it be better at this point to initialize nestjs and Typeorm seperat and not use the injection of nestjs and the TypeOrm module of Nestjs?


Solution

  • I found the solution myself right after I posted this. :D You just have to inject the EntityManager with @InjectEntityManager() and then you can access .getTreeRepository().