Hi! I need a little help with the prisma, I have some microservices that need to access the PrismaClient, how can I export the configurations, models and methods so that I can access them?
r
Ryan
11/17/2021, 9:15 AM
@Octavio Augusto Barbosa 👋
The general way would be to create an NPM package with Prisma and its schema that can be shared with other microservices.
o
Octavio Augusto Barbosa
11/17/2021, 11:03 AM
Hey @Ryan, I have an npm package created, how can I export the entire client to the other microservices?
r
Ryan
11/17/2021, 11:09 AM
Generating the client in a custom folder and packaging that should work fine. Then just downloading and creating an instance of
PrismaClient
from that package should work.
o
Octavio Augusto Barbosa
11/17/2021, 11:14 AM
Okay, I did that, but the typescript build doesn't copy the .prisma/client folder to the build folder, which is published in npm. Do I need to copy manually?