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

Add custom repository support #1422

Closed
1 task done
ruscon opened this issue Oct 2, 2022 · 3 comments
Closed
1 task done

Add custom repository support #1422

ruscon opened this issue Oct 2, 2022 · 3 comments
Labels

Comments

@ruscon
Copy link

ruscon commented Oct 2, 2022

Is there an existing issue that is already proposing this?

  • I have searched the existing issues

Is your feature request related to a problem? Please describe it

Feature request related to breaking changes between typeorm@^0.2 and typeorm@^0.3 versions

Describe the solution you'd like

A fully working solution is described here

Teachability, documentation, adoption, migration strategy

In order not to introduce breaking changes, we can add a separate method TypeOrmModule.forCustomRepositoryFeature which will do what the TypeOrmModule.forFeature method does now (maybe just call it) and at the same time logic to support custom repositories.

What is the motivation / use case for changing the behavior?

Ease of use and extensibility of the repository pattern with additional method definitions.

@ruscon ruscon added the feature label Oct 2, 2022
@micalevisk
Copy link
Member

micalevisk commented Oct 2, 2022

custom repositories are still supported already, but not the AbstractRepository one because it was deprecated in v0.3

As Repository and EntityRepository are defined on typeorm package (not @nestjs/typeorm) we would have to move their code to here (or something like that) in order to implement what you're requesting? 🤔 not sure if I follow. Or maybe just those pieces like described in that gist

@ruscon
Copy link
Author

ruscon commented Oct 2, 2022

@micalevisk

Or maybe just those pieces like described in that gist

I see no reason to copy all logic from typeorm@0.2 around the custom repository.
The solution described in the gist is sufficient.

@kamilmysliwiec
Copy link
Member

IMO this approach https://gist.github.com/anchan828/9e569f076e7bc18daf21c652f7c3d012?permalink_comment_id=4319458#gistcomment-4319458 is significantly simpler.

Anyways, there are no plans to implement it in the foreseeable future.

If you think your request could live outside Nest's scope, we'd encourage you to collaborate with the community on publishing it as an open source package.

@nestjs nestjs locked and limited conversation to collaborators Oct 3, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants