node-postgres icon indicating copy to clipboard operation
node-postgres copied to clipboard

GCP CloudSQL connection with unix socket

Open ggorge-etiqa opened this issue 1 year ago • 2 comments

Can you provide an example for connecting to GCP CloudSQL using unix socket?

ggorge-etiqa avatar Feb 14 '24 15:02 ggorge-etiqa

Not sure why any part of this would be specific to the combination of pg and Cloud SQL, although it looks like Cloud SQL already has documentation at https://github.com/GoogleCloudPlatform/cloud-sql-nodejs-connector.

Why do you believe using a Unix socket should be possible for what looks like a remote database? Is that connection type documented for some other driver?

charmander avatar Feb 15 '24 00:02 charmander

I think when connecting to a Cloud SQL instance you need to provide a connection string like /cloudsql/${GCP_PROJECT}:${CLOUDSQL_REGION}:${CLOUDSQL_INSTANCE_NAME}.

alxndrsn avatar Mar 17 '24 06:03 alxndrsn