How to connect to postgresql via unix socket


I want to execute kratos migrations in a google cloud build step. For this I am using the exec-wrapper docker image to set up a cloud sql proxy via a unix socket. The socket is found at /cloudsql/project-name:region:db

I would like to connect kratos to this socket using a connection string, e.g:
postgres://postgres:[email protected]/cloudsql/project-name:region:db:5432/kratos

unfortunately this is not parsed correctly. Any pointers in the right direction? Thanks!

Yes, you can use pgcon style connection strings:

Thanks @hackerman, I managed to get it working with:


1 Like