How do I specify username, password, db host, and ...
# orm-help
n
How do I specify username, password, db host, and db name individually instead of one DATABASE_URL?
Copy code
datasource db {
  provider = "postgresql"
  url      = env("DATABASE_URL")
}
n
Yup. Nothing helpful there.
What I wish to use is something like this:
Copy code
datasource db {
  provider = "postgresql"
  username      = env("DATABASE_USER")
  {{ ...more properties like password, host, port, db_name }}
}
j
Why would you wanna do something like that?
n
Most database libraries accept those aside from just the connection string. My credentials are stored as individual secrets. To use it with Prisma, I still have to concatenate them into one connection string.
An alternative would be for Prisma to support concatenating them.
Copy code
datasource db {
  provider = "postgresql"
  url      = "postgres://" + env("DATABASE_USER") + ":" + env("DATABASE_PASSWORD") + ...
}
r
@Noel Martin Llevares 👋 This isn’t possible at the moment, you need to pass the entire URL directly.
n
Thanks @Ryan
👍 1