I am trying to follow the tutorial at: And I am having the hardest time making my Google App Engine (GoLang) connect to the Cloud SQL Postgres database. I am able to connect NOT following the tutorial by manually opening the port from the firewall rules. But I cannot do it this way because it's connected via IP and if I do it this way, I cannot deploy to GAE.
Could someone please review the following GoLang code to see what is wrong. ``` *This following line is used to connect from localhost GoLang app to Cloud SQL -- NOT FOLLOWING THE TUTORIAL* db, err := sql.Open("postgres", host=IP_ADDRESS port=PORT user=USERNAME password=PASSWORD dbname=DBNAME sslmode=disable) Here, I am connecting to the Cloud SQL postgres database by IP address. I opened a port manually by firewall rule to make it accessible from my local IP. This works great but I cannot "deploy" my GoLang app to Google App Engine so this is not possible. --- *This does NOT work. It follows the tutorial. I tried 4 different variations.* connectionName = "CONNECTION_NAME" db, err := sql.Open("postgres", fmt.Sprintf("%s:%s@cloudsql(%s)", user, password, connectionName)) db, err := sql.Open("postgres", fmt.Sprintf("%s:%s@cloudsql(%s)/DB_NAME", user, password, connectionName)) db, err := sql.Open("postgres", fmt.Sprintf("postgres://%s:%s@cloudsql(%s)", user, password, connectionName)) db, err := sql.Open("postgres", fmt.Sprintf("postgres://%s:%s@cloudsql(%s)/ DB_NAME", user, password, connectionName)) All four of these variations do not work. And I do not know why. I could really use some help understanding why. The only difference between this and the tutorial is that I'm using "postgres", not "mysql". ``` Thank you so kindly in advance. -- You received this message because you are subscribed to the Google Groups "Google App Engine" group. To unsubscribe from this group and stop receiving emails from it, send an email to google-appengine+unsubscr...@googlegroups.com. To post to this group, send email to google-appengine@googlegroups.com. Visit this group at https://groups.google.com/group/google-appengine. To view this discussion on the web visit https://groups.google.com/d/msgid/google-appengine/2d7ae38a-8dbe-4836-84e4-d1d4d8651f30%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.