jm
06/22/2021, 8:13 AMfunctions.config()
(https://firebase.google.com/docs/functions/config-env)
But to connect to a database, prisma uses dotenv:
datasource db {
provider = "postgresql"
url = env("DATABASE_URL")
}
Is it possible to access functions.config()
in schema.prisma
file? I definitely donot want to hard code user name and password.janpio
janpio
janpio
jm
06/22/2021, 9:30 AM.env
DATABASE_URL="postgresql://...
schema.prisma
datasource db {
provider = "postgresql"
url = env("DATABASE_URL")
}
index.ts
const prisma = new PrismaClient({
datasources: {
db: {
url: functions.config().prisma.db,
},
},
})
I'll try it outjanpio
janpio