Using Cloud SQL with PSC?
I struggled with setting up a connection to Cloud SQL using Quarkus. The documentation at the time references the use of the socket factory and is correct, however, I had configured my Cloud SQL (Postgres) with Private Service Connect (PSC). PSC does not configure an IP address either Private or Public which causes the socket factory to fail.
If using PSC remove the socket factory dependency from the POM and use this config in application.properties.
quarkus.datasource.db-kind=postgresql
quarkus.datasource.username=postgres
quarkus.datasource.password=postgres
quarkus.datasource.jdbc.driver=org.postgresql.Driver
quarkus.datasource.jdbc.url=jdbc:postgresql://xxxxxxxxxxxxxxxxxx.us-central1.sql.goog./{mydbhere}
quarkus.datasource.jdbc.additional-jdbc-properties.cloudSqlInstance=project-id:gcp-region:instance