-
Notifications
You must be signed in to change notification settings - Fork 238
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
qe: support _count
in joined queries
#4678
Conversation
WASM Size
|
CodSpeed Performance ReportMerging #4678 will not alter performanceComparing Summary
|
🚀 WASM query-engine performance will improve by 2.44%Full benchmark report
After changes in b0de214 |
7d7c9b9
to
11d6ea7
Compare
query-engine/connectors/sql-query-connector/src/database/operations/read.rs
Show resolved
Hide resolved
} | ||
|
||
fn relation_count_alias_name(rf: &RelationField) -> String { | ||
format!("aggr_count_{}_{}", rf.model().name(), rf.name()) |
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.
Won't technically be necessary once https://github.com/prisma/team-orm/issues/903 is done, we could then replace it with a sequential alias if we want.
query-engine/connectors/sql-query-connector/src/query_builder/select.rs
Outdated
Show resolved
Hide resolved
query-engine/connectors/sql-query-connector/src/database/operations/coerce.rs
Show resolved
Hide resolved
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.
Looks good to me. Could you please update the main PR comment with examples of the generated SQL queries, for one2m and m2m? This is useful to get a concrete idea of the change.
Nice work 👍
query-engine/connectors/sql-query-connector/src/query_builder/select.rs
Outdated
Show resolved
Hide resolved
query-engine/connectors/sql-query-connector/src/database/operations/read.rs
Show resolved
Hide resolved
query-engine/connectors/sql-query-connector/src/database/operations/coerce.rs
Show resolved
Hide resolved
_count
in joined queries
8792bb9
to
c6af492
Compare
Description
Implement relation aggregations support for the
join
strategy:Next step: https://github.com/prisma/team-orm/issues/903
Part of: https://github.com/prisma/team-orm/issues/700
Closes: https://github.com/prisma/team-orm/issues/902
Examples
Schema
1:m, top-level
m:n, top-level
1:m, nested