fix(orm): enforce at most one key per orderBy array element#2563
Conversation
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
Claude finished @ymc9's task —— View job PR Review: OrderBy Array Validation FixReview Tasks
Analysis of ChangesCore Implementation (
Test Coverage (
Code Quality Assessment ✅Strengths:
Implementation Quality:
Potential Issues & Edge Cases ✅No significant issues found:
Performance Considerations ✅
Security Considerations ✅
Test Coverage Assessment ✅The test coverage is solid and covers key scenarios:
Suggestion: Consider adding a test for nested orderBy scenarios to ensure the refinement works correctly in relation contexts. Overall Recommendation ✅APPROVE - This is a well-implemented fix that:
The implementation is production-ready and adds valuable input validation without any significant drawbacks. |
|
Claude finished @ymc9's task —— View job PR Review: OrderBy Array Validation FixReview Tasks
Analysis of ChangesCore Implementation (
Test Coverage (
Code Quality Assessment ✅Strengths:
Implementation Quality:
Potential Issues & Edge Cases ✅No significant issues found:
Performance Considerations ✅
Security Considerations ✅
Test Coverage Assessment ✅The test coverage is solid and covers key scenarios:
Suggestion: Consider adding a test for nested orderBy scenarios to ensure the refinement works correctly in relation contexts. Overall Recommendation ✅APPROVE - This is a well-implemented fix that:
The implementation is production-ready and adds valuable input validation without any significant drawbacks. |
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughPrisma ORM's Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Poem
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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 |
Summary
makeOrderBySchemathat rejects objects with more than one key, enforcing Prisma's convention that each element in anorderByarray should specify exactly one sort fieldsafeExtend()(instead ofextend()) when adding_countto array-relation orderBy schemas, since Zod v4 disallows extending refined schemasorderByarray elements with multiple keys are rejectedTest plan
tests/e2e/orm/client-api/find.test.ts— new test:'rejects orderBy array elements with multiple keys'🤖 Generated with Claude Code
Summary by CodeRabbit
orderByparameter validation to enforce single-key constraint. The ORM now rejectsorderByobjects containing multiple sort keys, allowing only one sort field per query.