Couldn't we inject the extends functionality into the prismaService in nestjs?
@franky47 Жыл бұрын
2:29 what are the benefits of calling extends in the extension definition, compared to the object declaration syntax? Since the result of Prisma.defineExtension will be extended by users, wouldn't that be redundant?
@PrismaData Жыл бұрын
Thanks for your question! I'm sure others may have the same thoughts, so I'll explain. ***defineExtension*** is here for two purposes, but in simpler words, it's all about share-ability: - It allows you to define an extension outside of the client. You may want to keep it in a separate file. Also, you get the inference and the fancy types that you'd otherwise get on the $extends call. - If you're an extension author, it is the only way to define an extension so it can be shared as a package.
@PrismaData Жыл бұрын
What will you build with Prisma Client extensions? Remember to share them with us! Repo can be found here: github.com/sabinadams/prisma-field-picker
@Broski_Rodragweez9 ай бұрын
But you did still use map(), you just did so in side your extension rather then in the code that calls the prisma query.
@Pesca.Shorts Жыл бұрын
possible queryraw()?
@justine_chang398 ай бұрын
awesome
@t3ntube3578 ай бұрын
why you wrote what you wrote???
@jjoonjj714 Жыл бұрын
Is it possible to create an extension that uses the client with another extension?
@PrismaData Жыл бұрын
Yup! You can continue to extend a client to add more functionality.
@jjoonjj714 Жыл бұрын
@@PrismaData Is there an example of this somewhere, would like to see it
@PrismaData Жыл бұрын
@@jjoonjj714 Hopefully this helps! www.prisma.io/docs/concepts/components/prisma-client/client-extensions#multiple-extensions