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

How to avoid the N+1 problem? #210

Open
gebekov opened this issue Nov 29, 2024 · 0 comments
Open

How to avoid the N+1 problem? #210

gebekov opened this issue Nov 29, 2024 · 0 comments

Comments

@gebekov
Copy link

gebekov commented Nov 29, 2024

Hi! Thanks for the great library 🙂!

I have a question:
Is there a way to avoid N+1 problems when mapping collections from DTO using transformers/providers (e.g. I keep identifiers in the DTOs and I want them to be loaded from the DB)? Unfortunately I couldn't find a clear answer to my question in the documentation.

The most obvious solution is to retrieve the required objects from the database in advance, before mapping, and pass them to the context. And then pass those objects from the context, but it seems to me that this is not a good solution. Is there another way to map collections?

Thanks in advance!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant