-
-
Notifications
You must be signed in to change notification settings - Fork 91
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
fix(delegate): several generation issues #1417
Conversation
- TS code compilation errors when delegate models don't have concrete sub types - Prisma schema error when a delegate model has relation to another delegate model
WalkthroughWalkthroughThe recent updates primarily focus on enhancing schema generation and error handling in the Prisma client. Changes include direct execution of Changes
Assessment against linked issues
Possibly related issues
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
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 as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
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.
Actionable comments posted: 0
Review Details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (4)
- packages/schema/src/plugins/enhancer/enhance/index.ts (2 hunks)
- packages/schema/src/plugins/prisma/schema-generator.ts (1 hunks)
- tests/regression/tests/issue-1415.test.ts (1 hunks)
- tests/regression/tests/issue-1416.test.ts (1 hunks)
Files skipped from review due to trivial changes (1)
- tests/regression/tests/issue-1415.test.ts
Additional comments not posted (3)
tests/regression/tests/issue-1416.test.ts (1)
3-37
: The test case appears to correctly simulate the scenario described in issue 1416, focusing on delegate models and their relationships. The schema includes models with delegate relationships and inheritance, which are central to the issue.packages/schema/src/plugins/enhancer/enhance/index.ts (1)
217-269
: The logic for generating a logical Prisma client and handling typing fixes appears to be correctly implemented. The use of a temporary schema file and the cleanup process are well-handled, ensuring that resources are managed properly.packages/schema/src/plugins/prisma/schema-generator.ts (1)
377-381
: The adjustment to skip processing fields inherited from a delegate model before generating auxiliary opposite relation fields is a crucial change. This should effectively prevent the schema errors related to delegate relations that were previously occurring.
Fixes #1415 #1416