I'm trying to connect my Cloud run container to my PostgreSQL 11 database using this connection string
postgresql+psycopg2://username:password@/db?host=/cloudsql/project-name:region:dbinstance
when I try to run my container it will give back this error
2019-10-24 13:30:53.910 CEST sqlalchemy.exc.OperationalError: (psycopg2.OperationalError) could not connect to server: Connection refused
2019-10-24 13:30:53.910 CEST Is the server running locally and accepting
2019-10-24 13:30:53.910 CEST connections on Unix domain socket "/cloudsql/project-name:region:dbinstance/.s.PGSQL.5432"?
2019-10-24 13:30:53.910 CEST(Background on this error at: http://sqlalche.me/e/e3q8)
I've also tried to use this connection string
postgresql+psycopg2://username:password@/db?unix_socket=/cloudsql/project-name:region:dbinstance
that returned this error message
2019-10-24 11:11:43.733 CESTsqlalchemy.exc.ProgrammingError: (psycopg2.ProgrammingError) invalid dsn: invalid connection option "unix_socket"
2019-10-24 11:11:43.733 CEST(Background on this error at: http://sqlalche.me/e/f405)
2019-10-24 11:11:44.469 CESTContainer called exit(1).