-
-
Notifications
You must be signed in to change notification settings - Fork 127
feat: allow to pass in a custom Prisma module when calling enhance
#1160
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
WalkthroughWalkthroughThe recent updates focus on enhancing policy handling and error management in the runtime package by integrating Changes
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.
Review Status
Actionable comments generated: 2
Configuration used: CodeRabbit UI
Files selected for processing (5)
- packages/runtime/src/enhancements/policy/handler.ts (13 hunks)
- packages/runtime/src/enhancements/policy/policy-utils.ts (3 hunks)
- packages/runtime/src/enhancements/types.ts (1 hunks)
- packages/runtime/src/enhancements/utils.ts (2 hunks)
- tests/integration/tests/enhancements/with-policy/options.test.ts (3 hunks)
Files not reviewed due to errors (1)
- (no review received)
Additional comments: 8
tests/integration/tests/enhancements/with-policy/options.test.ts (2)
- 29-29: The
enhancefunction is called withundefinedas the second argument, which seems to be a placeholder for future options. Consider documenting this choice or providing a comment for clarity.- 54-54: Using a custom
Prismamodule in theenhancefunction call demonstrates the new functionality well. Ensure that thePrismamodule passed here is correctly instantiated and matches the expected type.packages/runtime/src/enhancements/utils.ts (3)
- 57-61: The addition of the
optionsparameter toprismaClientValidationErrorand its use to optionally load a customPrismamodule is a good implementation of the new feature. Ensure that theEnhancementOptionstype correctly defines theprismaModuleproperty and that error handling is robust.- 69-73: Similar to
prismaClientValidationError, the update toprismaClientKnownRequestErrorto accept anoptionsparameter enhances the function's flexibility. Verify that the rest of the codebase correctly passes this parameter where these functions are used.- 81-85: The update to
prismaClientUnknownRequestErrorfollows the same pattern as the previous functions, correctly implementing the new functionality. Consistency in handling theoptionsparameter across these functions is key to the feature's success.packages/runtime/src/enhancements/policy/policy-utils.ts (3)
- 8-8: The import of
EnhancementOptionsis correctly added to support the new functionality.- 52-52: The addition of the
optionsparameter to thePolicyUtilconstructor is correctly implemented to support enhancement options. Consider adding documentation comments for the new parameter to explain its purpose and usage.- 1103-1103: The updates to method calls to include
this.optionsare correctly implemented, ensuring that utility functions can utilize the new enhancement options. Verify that all relevant methods have been updated to passthis.optionswhere necessary.Also applies to: 1110-1110, 1117-1117, 1121-1121
Summary by CodeRabbit