How to define datasource for multiple connection (development and production) Prisma

1.4k views Asked by At

I have a prisma configuration: datasource db { provider = "postgresql" url = "postgresql://johndoe:mypassword@localhost:5432/mydb?schema=public&sslmode=require&sslcert=../server-ca.pem&sslidentity=../client-identity.p12&sslpassword=" } Will like to know how we can specify the development and test DB explicitly

1

There are 1 answers

0
Ryan On

You can use [dotenv-cli] to specify the database URL's for dev and test.

Here it's explained how you can switch the URL based on the env file that you have.