I'm trying to connect to my Cloud SQL DB using SQLAlchemy from my cloud function but I can't seem to work out the correct connection string.
DATABASE_URL=postgres://$DB_USER:$_DB_PWD@/$DB_NAME?unix_socket=/cloudsql/$DB_INSTANCE
Which gives me the error:
pyscopg2.ProgrammingError: invalid dns: invalid connection option "unix_socket"
What is the correct way to connect to a Postgresql 9.6 DB over a unix socket using pyscopg2
?