-
-
Notifications
You must be signed in to change notification settings - Fork 11
fix: error when selecting relation that contains computed fields #172
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
Conversation
|
Note Other AI code review bot(s) detectedCodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review. Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the ✨ Finishing Touches🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
Status, Documentation and Community
|
|
Claude finished @ymc9's task —— View job Code Review for PR #172: fix: error when selecting relation that contains computed fields
|
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.
Pull Request Overview
This PR fixes an error when selecting relations that contain computed fields by preventing the inlining of computed field expressions in relation selections. The fix involves adding a parameter to control when computed fields should be inlined versus referenced as plain column names.
Key changes:
- Added
inlineComputedFieldparameter tobuildFieldRefand related functions to control computed field behavior - Modified SQLite and PostgreSQL dialects to disable computed field inlining when building relation selections
- Added comprehensive test coverage for the fix across both SQLite and PostgreSQL providers
Reviewed Changes
Copilot reviewed 27 out of 27 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| packages/runtime/src/client/query-utils.ts | Added inlineComputedField parameter to buildFieldRef function |
| packages/runtime/src/client/crud/dialects/base.ts | Updated fieldRef method signature to support the new parameter |
| packages/runtime/src/client/crud/dialects/sqlite.ts | Modified relation field selection to disable computed field inlining |
| packages/runtime/src/client/crud/dialects/postgresql.ts | Modified relation field selection to disable computed field inlining |
| packages/runtime/test/client-api/computed-fields.test.ts | Added comprehensive test coverage for the fix |
| Multiple tsconfig.json files | Updated TypeScript configuration for better type checking |
| Multiple package.json files | Added TypeScript type checking to build scripts |
| packages/language/src/validators/typedef-validator.ts | Fixed type import to use correct AST type |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
You can also share your feedback on Copilot code review for a chance to win a $100 gift card. Take the survey.
|
Claude finished @ymc9's task —— View job Code Review for PR #172: fix: error when selecting relation that contains computed fields I'll review this pull request focusing on code quality, potential issues, performance, security, and test coverage. Analysis SummaryThis PR fixes an issue where selecting relations that contain computed fields would fail. The root cause was that computed field references were being inlined even when building relation selections, causing SQL generation issues. Key Changes Reviewed1. Core Fix in
2. Dialect Updates (
3. Enhanced Test Coverage (
Code Quality AssessmentStrengths:
Areas for Improvement:
Technical AnalysisPerformance: ✅ Good
Security: ✅ No concerns
Type Safety: ✅ Good
Test Coverage AssessmentStrengths:
Potential Gaps:
Other NotesUnrelated Change:
Recommendations
ConclusionThis is a well-executed bug fix that addresses a specific issue with computed fields in relation selections. The implementation is clean, targeted, and maintains backward compatibility. The test coverage adequately covers the regression case. The changes follow good software engineering practices with minimal risk of side effects. Overall Assessment: ✅ Ready to merge with minor documentation improvements recommended. |

No description provided.