prisma-client-go icon indicating copy to clipboard operation
prisma-client-go copied to clipboard

set datasource url programmatically

Open araufdogan opened this issue 4 years ago • 1 comments

Hello,

I have my own config file and I want to set datasource url programmatically in prisma file. How can I do this?

araufdogan avatar Dec 24 '20 13:12 araufdogan

It's not possible right now. I have already raised this internally.

In the meanwhile, you can declare an environment variable in the schema file and provide that directly or use os.Setenv:

datasource db {
  provider = "mysql"
  url      = env("DATABASE_URL")
}

steebchen avatar Dec 24 '20 13:12 steebchen

You can now override the data source URL, see #1060

steebchen avatar Oct 25 '23 22:10 steebchen