is it possible to have two different clients? I wa...
# prisma-client
m
is it possible to have two different clients? I want to write a data migration between two databases
r
Yes. Their generated output should be in different folders
m
hm okay, I should have two generated clients (hrt and platform-repo), when I use the hrt client it works fine but the repo client says the Tenant table doesn’t exist (it does in that database)
not sure what I’m doing wrong
slightly better screenshot:
r
How have you defined it in your schema.prisma?
m
i have two different prisma dirs
r
But they would generate in the same
node_modules
right?
m
they are different packages/workspaces in my NPM v7 monorepo
r
Try specifying the
ouptut
as shown here.
m
it seems like the clients are correct though because I can import two different clients and the have the expected types for my tables. i’m wondering if they’re sharing a connection or something though because I don’t know why else
platformClient
would have
tenant
but not see the table when querying
r
Is this something that I could check out? A monorepo with two PrismaClient should work fine but I’d like to check.
m
sure, what’s your github username?
r
ryands17
p
@Mischa they are both sharing the same environment variable
DATABASE_URL
you can either change the schema to use different variables or you can set the connection uri on runtime as an argument to the
PrismaClient
m
ah great catch! thank you so much!