Repository navigation
feat: allow VirtualColumns to be initially non-selectable - #11586
Conversation
WalkthroughA new Changes
Sequence Diagram(s)sequenceDiagram
participant TestSuite
participant Repository
participant CompanyEntity
participant QueryBuilder
TestSuite->>Repository: Save Company with nested Employees, Timesheets, Activities
Repository->>CompanyEntity: Persist entity and relations (with cascade)
TestSuite->>QueryBuilder: Find Company (default select)
QueryBuilder->>CompanyEntity: Retrieve columns (excluding select: false virtuals)
TestSuite->>QueryBuilder: AddSelect('totalReportedHours')
QueryBuilder->>CompanyEntity: Retrieve columns (including totalReportedHours)
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
Note ⚡️ Unit Test Generation is now available in beta!Learn more here, or try it out under "Finishing Touches" below. 📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (6)
🔇 Additional comments (15)
✨ 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. 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
CodeRabbit Configuration File (
|
commit: |
| * Indicates if column is always selected by QueryBuilder and find operations. | ||
| * Default value is "true". | ||
| */ | ||
| select?: boolean |
There was a problem hiding this comment.
I don't see this value used in the changed code. Is there a test that checks that virtual column now can be un-selected?
There was a problem hiding this comment.
Yes: "should be able to read non-selectable virtual columns (with query builder)" checks if Company.totalReportedHours is returned correctly when that column is explicitly selected.
BTW, this feature already exists for regular Columns. This PR just enables it for VirtualColumns (basically in types only) + fixes a bug with adding the select twice.
Description of change
Allows the user to declare
VirtualColumns that by default are not selected, similar to regular columns. They can be explicitly selected usingQueryBuilder.addSelectorFindOptions.select.Fixes #11277
Pull-Request Checklist
masterbranchFixes #00000Summary by CodeRabbit
New Features
Bug Fixes
Tests
Refactor