David Ressler
10/17/2022, 6:02 PMknex
as an example):
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:
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?Raphael Etim
10/17/2022, 8:41 PMDavid Ressler
10/17/2022, 8:46 PMRaphael Etim
10/17/2022, 9:00 PMRaphael Etim
10/18/2022, 9:44 AMgcloud 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>"
David Ressler
10/18/2022, 2:47 PMVladi Stevanovic