-
Notifications
You must be signed in to change notification settings - Fork 218
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
fix: support 1-m relevance ordering #4915
base: main
Are you sure you want to change the base?
Conversation
CodSpeed Performance ReportMerging #4915 will not alter performanceComparing Summary
|
WASM Query Engine file Size
|
let parent_alias = self.parent_alias.clone(); | ||
let joins: Vec<AliasedJoin> = self.compute_one2m_join(&order_by.path, parent_alias.as_ref(), ctx); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Relations weren't taken into account at all. We're now gathering the path
(which is an array of relation fields) that leads to the fields we try to order by on. We compute the needed joins, and then we order by the last field, aliased by the last join alias. This is the same process as regular relational ordering on scalar field.
You're an absolute hero |
@@ -376,6 +376,92 @@ async fn on_many_fields_with_aggr_and_pagination(runner: Runner) -> TestResult<( | |||
Ok(()) | |||
} | |||
|
|||
async fn on_1m_relation_field(runner: Runner) -> TestResult<()> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add tests where we hop through several to-one relations
Overview
fixes prisma/prisma#17428
fixes prisma/prisma#21107