-
-
Notifications
You must be signed in to change notification settings - Fork 12
fix: nested select result typing, simplifying ORM query result types #92
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 Currently processing new changes in this PR. This may take a few minutes, please wait... 📒 Files selected for processing (4)
Tip You can get early access to new features in CodeRabbit.Enable the ✨ Finishing Touches
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. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
Documentation and Community
|
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 nested select result typing in the ORM by simplifying query result types. The main change involves updating the type system to properly handle nested select queries with mixed include/omit operations and applying a Simplify type utility to flatten complex type intersections.
- Enhances the
ModelSelectResulttype to properly differentiate betweenselectandinclude/omitoperations in nested queries - Applies the
Simplifytype utility to all ORM operation return types to improve TypeScript IntelliSense and readability - Adds comprehensive test cases for nested select scenarios with complex field selection patterns
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| packages/runtime/test/typing/verify-typing.ts | Adds test cases for nested select operations with author relations and mixed include/omit scenarios |
| packages/runtime/src/utils/type-utils.ts | Moves and improves the Simplify type utility with recursive object flattening |
| packages/runtime/src/client/crud-types.ts | Enhances ModelSelectResult to properly handle nested select vs include/omit operations |
| packages/runtime/src/client/contract.ts | Wraps all ORM operation return types with Simplify for better type display |
Co-authored-by: Copilot <[email protected]>
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
Docstrings generation was requested by @ymc9. * #92 (comment) The following files were modified: * `packages/runtime/src/utils/type-utils.ts` * `packages/runtime/test/typing/verify-typing.ts`
|
Note Generated docstrings for this pull request at #93 |
Summary by CodeRabbit
Refactor
Style
Tests