File tree Expand file tree Collapse file tree 1 file changed +7
-0
lines changed
Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -171,6 +171,13 @@ func getDBConnection(store *Datastore) *runner.DB {
171171 host , port , _ := net .SplitHostPort (u .Host )
172172 dbName := strings .Replace (u .Path , "/" , "" , 1 )
173173
174+ if host == "GCLOUD_SQL_INSTANCE" {
175+ // USE THE GCLOUD_SQL_INSTANCE SETTING instead... e.g. host= /cloudsql/INSTANCE_CONNECTION_NAME // JC I wonder if it is always /cloudsql
176+ host = store .Settings .Get ("GCLOUD_SQL_INSTANCE" )
177+ }
178+
179+ store .Logger .Info ("dbname=" + dbName + " user=" + username + " host=" + host + " port=" + port + " sslmode=disable" ) // no pass
180+
174181 db , _ := sql .Open ("postgres" , "dbname=" + dbName + " user=" + username + " password=" + pass + " host=" + host + " port=" + port + " sslmode=disable" )
175182 err = db .Ping ()
176183 if err != nil {
You can’t perform that action at this time.
0 commit comments