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

perf: filter toMany select relations with where #22

Merged
merged 1 commit into from
Jan 13, 2024

Conversation

olivierwilkinson
Copy link
Owner

Rather than filtering results when selecting a toMany relation ensure that the relation is filtered using a modified where object in the query.

This was previously difficult due to the nature of the select action: it was impossible to distinguish between an include.select and a relational select action.

Upgrading to v4 of prisma-nested-middleware removes the include.select variant of the select action, allowing this library to remove the logic that deferred select actions within an include to the parent action. That logic that deferred to the parent also prevented always modifying the select action to use the where strategy.

Rather than filtering results when selecting a toMany relation ensure
that the relation is filtered using a modified where object in the
query.

This was previously difficult due to the nature of the select action:
it was impossible to distinguish between an include.select and a
relational select action.

Upgrading to v4 of prisma-nested-middleware removes the include.select
variant of the select action, allowing this library to remove the logic
that deferred select actions within an include to the parent action.
That logic that deferred to the parent also prevented always modifying
the select action to use the where strategy.
@olivierwilkinson olivierwilkinson merged commit 76f54be into main Jan 13, 2024
2 checks passed
@olivierwilkinson olivierwilkinson deleted the refactor-handling-of-selects branch January 13, 2024 16:53
Copy link

🎉 This PR is included in version 1.2.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

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

Successfully merging this pull request may close these issues.

1 participant