-
-
Notifications
You must be signed in to change notification settings - Fork 17
fix(orm): cuid() generator should respect version argument #547
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
|
Claude finished @ymc9's task —— View job PR Review: feat(orm): support where enum
|
📝 WalkthroughWalkthroughThis PR introduces argument-level validation for UUID, CUID, and Nanoid function invocations, enforcing version constraints (UUID v4/v7, CUID v1/v2) and positive lengths for Nanoid, along with corresponding runtime generation logic that selects appropriate implementation based on detected versions, and updates dependencies to include CUID v3. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~22 minutes Possibly related PRs
Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (6)
🧰 Additional context used📓 Path-based instructions (1)tests/e2e/**/*.{ts,tsx}📄 CodeRabbit inference engine (CLAUDE.md)
Files:
🧠 Learnings (6)📚 Learning: 2025-11-26T01:55:04.540ZApplied to files:
📚 Learning: 2025-11-26T01:55:04.540ZApplied to files:
📚 Learning: 2025-11-26T01:55:04.540ZApplied to files:
📚 Learning: 2025-11-26T01:55:04.540ZApplied to files:
📚 Learning: 2025-11-26T01:55:04.540ZApplied to files:
📚 Learning: 2025-11-26T01:55:04.540ZApplied to files:
🧬 Code graph analysis (2)packages/orm/src/client/crud/operations/base.ts (1)
packages/language/src/validators/function-invocation-validator.ts (3)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
🔇 Additional comments (15)
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 |
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 versioned ID generators in the ORM's default value functions. The changes enable developers to specify versions for uuid() (v4 or v7) and cuid() (v1 or v2) functions, with defaults of v4 for uuid and v1 for cuid when no version is specified.
Key changes:
- Added cuid v1 support via the
cuidpackage (v3.0.0) alongside existing cuid2 support - Implemented validation for uuid versions (4 or 7), cuid versions (1 or 2), and nanoid lengths (positive numbers)
- Updated tests to verify correct version handling for all ID generator functions
Reviewed changes
Copilot reviewed 6 out of 7 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/e2e/package.json | Added cuid package dependency for cuid v1 support |
| tests/e2e/orm/client-api/default-values.test.ts | Refactored tests to verify version-specific ID generation for uuid, cuid, and nanoid |
| pnpm-lock.yaml | Updated lockfile with cuid package and its metadata |
| packages/orm/src/client/crud/operations/base.ts | Implemented version branching for cuid (v1/v2) and uuid (v4/v7) generators |
| packages/orm/package.json | Added cuid package as a dependency |
| packages/language/test/function-invocation.test.ts | Added comprehensive validation tests for uuid, cuid, and nanoid parameter constraints |
| packages/language/src/validators/function-invocation-validator.ts | Implemented validators to enforce version constraints for uuid, cuid, and nanoid functions |
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Summary by CodeRabbit
Release Notes
New Features
Tests
✏️ Tip: You can customize this high-level summary in your review settings.