PrismaP
Prisma16mo ago
3 replies
Marcel Overdijk

How to setup multiple Prisma clients in combination with `prismaSchemaFolder`

I'm trying to setup multiple Prisma clients (as I have 2 sperate databases) in combination with prismaSchemaFolder.
As I'm having 2 Prisma clients I need to define the ouput folder manually like:
generator client {
  output          = "../../../node_modules/@prisma/db1/client/"
  provider        = "prisma-client-js"
  previewFeatures = ["prismaSchemaFolder"]
}

1) Is that output fulder the recommended destination in this use case?

The generated files look good as far as I can see, however when importing this later like:

import { PrismaClient as db1PrismaClient } from '@prisma/db1/client';


I get the following error:

Cannot find module '@prisma/db1/client'
Was this page helpful?