Conversation
Weakky
commented
Dec 8, 2023
| .left_join(m2m_join_data) // join m2m table | ||
| .and_where(join_conditions) // adds join condition to the child table | ||
| .with_ordering(&rs.args, Some(join_alias_name(&rs.field)), ctx) // adds ordering stmts | ||
| .with_filters(rs.args.filter.clone(), None, ctx) // adds query filters // TODO: avoid clone filter |
Contributor
Author
There was a problem hiding this comment.
Parent alias passed to the filters
Weakky
commented
Dec 8, 2023
| .value(Column::from((m2m_join_alias.to_table_string(), JSON_AGG_IDENT))) | ||
| .left_join(m2m_join_data) // join m2m table | ||
| .and_where(join_conditions) // adds join condition to the child table | ||
| .with_ordering(&rs.args, Some(join_alias_name(&rs.field)), ctx) // adds ordering stmts |
Contributor
Author
There was a problem hiding this comment.
Updated ordering parent alias (same as filtering)
Weakky
commented
Dec 8, 2023
| fn build_m2m_join<'a>(&mut self, rs: &RelationSelection, parent_alias: Alias, ctx: &Context<'_>) -> JoinData<'a> { | ||
| let rf = rs.field.clone(); | ||
| let m2m_alias = m2m_join_alias_name(&rf); | ||
| let m2m_table_alias = self.next_alias(); |
Contributor
Author
There was a problem hiding this comment.
We know use Alias instead of the generated string. This is to enable passing the alias to the FilterVisitor which expects an Alias and not a random string.
CodSpeed Performance ReportMerging #4549 will not alter performanceComparing Summary
|
miguelff
approved these changes
Dec 11, 2023
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
fixes prisma/prisma#22311
fixes prisma/prisma#22299
WHERE Table.id = 1instead ofWHERE t4.id = 1