You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Apply QueryFields expansion to UPDATE ... RETURNING *
This PR updates update callbacks to replace RETURNING * with explicit schema columns when QueryFields is enabled, aligning update-returning behavior with existing select expansion. It adds helper logic to rewrite the RETURNING clause and introduces tests to validate that wildcard returning is eliminated across supported dialects, with qualified columns where applicable.
Key Changes
• Added applyQueryFieldsToReturningClause in callbacks/update.go to expand clause.Returning* into explicit schema columns when db.QueryFields is true
• Invoked applyQueryFieldsToReturningClause during update clause setup when RETURNING is supported
• Added tests in callbacks/update_test.go and tests/update_test.go to ensure RETURNING/OUTPUT uses explicit columns rather than *
Affected Areas
• callbacks/update.go update callback flow
• callbacks/update_test.go unit test coverage
• tests/update_test.go integration-style update returning tests
This summary was automatically generated by @propel-code-bot
The reason will be displayed to describe this comment to others. Learn more.
No issues found; changes appear correct and well-tested.
Status: No Issues Found | Risk: Low
Review Details
📁 3 files reviewed | 💬 0 comments
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
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.
What did this pull request do?
Apply
QueryFieldstoUPDATE ... RETURNING *by replacing the wildcard returning clause with explicit schema columns.User Case Description
QueryFieldsalready expandsSELECT *into explicit columns in regular query paths.However,
UPDATE ... RETURNING *still uses a wildcard even whenQueryFieldsis enabled.This change makes update-returning queries consistent with the existing
QueryFieldsbehavior.Fixes #7690