-
-
Notifications
You must be signed in to change notification settings - Fork 12
fix(orm): allow null for select/include/omit
#402
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
|
Warning Rate limit exceeded@ymc9 has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 15 minutes and 39 seconds before requesting another review. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. 📒 Files selected for processing (1)
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. WalkthroughThe changes extend the Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes
Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
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. Comment |
|
Claude finished @ymc9's task —— View job Code Review CompleteI'll review this PR that allows Todo List
Review SummaryThis PR makes a small but valuable improvement by allowing Changes AnalysisFiles Modified:
Code Quality Assessment✅ Positive Aspects:
Technical EvaluationType Safety ✅
Runtime Validation ✅
Performance ✅
Security ✅
API Design ConsiderationsThis change aligns with common JavaScript/TypeScript patterns where:
The change allows developers to write more natural code: // Before: Had to omit or use undefined
const result = await db.user.findMany({
select: someCondition ? { name: true } : undefined
});
// After: Can use null more naturally
const result = await db.user.findMany({
select: someCondition ? { name: true } : null
});Test Coverage Assessment
Recommendations
SummaryThis is a well-implemented, low-risk change that improves API ergonomics without breaking existing functionality. The implementation correctly handles both TypeScript types and runtime validation. I recommend approving this PR. |
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 adds support for null values for the select, include, and omit fields in ORM queries. The changes ensure that these fields can accept null in addition to being optional or having their expected object/boolean values.
- Modified the Zod validator schemas to accept
nullvalues by chaining.nullable()after.optional() - Updated TypeScript type definitions to include
| nullin the union types for these fields
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| packages/orm/src/client/crud/validator/index.ts | Added .nullable() to the Zod schema definitions for select, include, and omit fields in the makeFindSchema method |
| packages/orm/src/client/crud-types.ts | Updated TypeScript type definitions to include null in the union types for select, include, and omit in SelectIncludeOmit |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Claude finished @ymc9's task —— View job Code Review CompleteI'll review this PR that allows Todo List
Review SummaryThis PR makes a small but valuable improvement by allowing Changes AnalysisFiles Modified:
Code Quality Assessment✅ Positive Aspects:
Technical EvaluationType Safety ✅
Runtime Validation
|
Summary by CodeRabbit
Release Notes
Bug Fixes
select,include, andomitparameters in find operations.Refactor