Hello! I am trying to leverage Prisma within a Clo...
# orm-help
d
Hello! I am trying to leverage Prisma within a Cloud Run container and through connecting to a Cloud SQL PostgreSQL instance. Within my Cloud Run container, I am able to connect to my Cloud SQL database without Prisma by doing something like this (using
knex
as an example):
Copy code
knex({
  client: 'pg',
  connection: {
    user: '...',
    password: '...',
    database: '...',
    host: `/cloudsql/${INSTANCE_NAME}`
  }
})
I have so far been unable to connect to Prisma using the
/cloudsql
reference to my Cloud SQL instance, though. I am able to connect if I run the Cloud SQL Auth proxy locally and do something like this:
Copy code
datasource db {
  provider = "postgresql"
  url      = "postgresql://...:...@localhost/...?host=127.0.0.1"
}
But I would ideally love to be able to connect to Prisma using the
/cloudsql
host name. Does anyone know if this is possible?
👀 1
r
Hi @David Ressler 👋 Have you taken a look at this resource about connecting to cloud sql in cloud run using Prisma?
d
@Raphael Etim I have, and I am unable to get it work.
r
I'm currently investigating that for you.
❤️ 1
Hi @David Ressler, Can you please confirm if this is how you're deploying your app using gcloud
Copy code
gcloud run deploy PROJECT_NAME \
 --source . \
 --project PROJECT_ID \
 --platform=managed \
 --region REGION \
 --allow-unauthenticated \
 --add-cloudsql-instances PROJECT_ID:REGION:NAME \
 --set-env-vars="DATABASE_URL=<postgresql://postgres:password@localhost:5432/postgres?host=/cloudsql/PROJECT_ID:REGION:NAME>"
d
@Raphael Etim yes
v
Hey @David Ressler this is just to let you know that we haven't forgotten about this! @Raphael Etim is still working on it and we'll get to it asap. Thank you for your patience! 🙏 😊