Fix generics model pointers for updates and add Join method#7730
Fix generics model pointers for updates and add Join method#7730MarlinKuhn wants to merge 6 commits intogo-gorm:masterfrom
Conversation
|
Add generic This PR adds a new Additionally, several generics update/create paths now pass a pointer model via Key Changes• Added Affected Areas• This summary was automatically generated by @propel-code-bot |
There was a problem hiding this comment.
Join handling may drop subqueries, requiring adjustment for correctness.
Status: Changes Suggested | Risk: Medium
Issues Identified & Suggestions
- Handle subquery joins in Join to avoid silent drops:
generics.go
Review Details
📁 1 files reviewed | 💬 1 comments
👍 / 👎 individual comments to help improve reviews for you
| } | ||
| } | ||
|
|
||
| join := clause.Join{ |
There was a problem hiding this comment.
[Logic] Join ignores jt.Subquery. If callers use JoinTarget.AssociationFrom or populate Subquery, this will silently drop the subquery and join on jt.Association as a table name. Is that intentional? If subquery joins should work here, add handling similar to Joins (building join.Expression with a NamedExpr over jt.Subquery).
Context for Agents
`Join` ignores `jt.Subquery`. If callers use `JoinTarget.AssociationFrom` or populate `Subquery`, this will silently drop the subquery and join on `jt.Association` as a table name. Is that intentional? If subquery joins should work here, add handling similar to `Joins` (building `join.Expression` with a `NamedExpr` over `jt.Subquery`).
File: generics.go
Line: 452
What did this pull request do?
Fixes #7713
User Case Description
If you use generics and want to use the Set to update values on a model with hooks it fails currently.