Skip to content
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

Export internal functions #13

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

leonard-henriquez
Copy link

In our codebase we use multiple extensions that implement $allModels.$allOperations.
They need to be chained and work together so we need to access the internal functions.

@@ -9,6 +9,7 @@
"build": "npm-run-all build:cjs build:esm",
"build:cjs": "tsc -p tsconfig.build.json",
"build:esm": "tsc -p tsconfig.esm.json",
"prepare": "npm run build",
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needed to use the package from a fork

@olivierwilkinson
Copy link
Owner

Heya, thanks for trying out the library!

I just want to understand what your use case is for using these new exported functions. From your description it sounds like you want to chain $allOperation hooks, what is preventing you from using chained extensions directly? The expected way of chaining extensions is like so:

const client = new PrismaClient()
  .$extends(extensionOne)
  .$extends(extensionTwo)

Each extension can have it's own $allOperations hook so it is effectively achieving what you have described.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants