#Using Custom Repository get a RepositoryNotFoundError

34 messages · Page 1 of 1 (latest)

inland zephyr
#

When i try to implement the custom repository i get the above error!

#

This is what i follow

#

This is my code

raw acorn
#

What's your Typeorm version?

inland zephyr
#
  • typeorm: 0.2.41
  • @nestjs/typeorm: 9.0.1
#

Currently i know that the @EntityRepository does not work any more

#

But i dont have any alternation at the moment

raw acorn
#

@nestjs/typeorm: ^9.0.0 uses typeorm 0.3.x doesn't it?

inland zephyr
#

to approach the custom Repository

inland zephyr
raw acorn
inland zephyr
#

oh yeah

#

@raw acorn How can i implement custom Repo with 0.3.10 typeorm

#

Do you have any article or so?

raw acorn
#

#1034657005169823794

inland zephyr
#

I see your approach!

#

But your suggest will have a disadvantages is that you can not extends any of the repo but have to create one

#

for example: you can not have this.delete()

#

but instead you have to create a function inside the featureRepo to do something like

#

deleteOne(){ this.repo.deleteOne}

raw acorn
inland zephyr
#

I think it will take more time

raw acorn
#

Like, how much more time do you think it would take to call this.repo.delete() vs this.delete()?

#

It's just accessing a class member, vs accessing a class method. It should be almost negligible, right? Maybe a millisecond

#

And that's at absolute worst case

inland zephyr
#

i think it would make user confuse

#

for example i import a user repo

#

i will use it like

#

this.userRepo.repo.delete