Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added one more GCP connection string example for flexible environment. #993

Merged
merged 4 commits into from Sep 4, 2019

Conversation

cn007b
Copy link
Contributor

@cn007b cn007b commented Sep 4, 2019

Description

Added one more GCP connection string example for flexible environment.

Checklist

  • Code compiles correctly
  • Created tests which fail without the change (if possible)
  • All tests passing
  • Extended the README / documentation, if necessary
  • Added myself / the copyright holder to the AUTHORS file

@methane
Copy link
Member

methane commented Sep 4, 2019

Would you confirm an example in Standard 2nd example is OK?

As far as I can see, Google uses unix protocol in their example. (see here)

cloudsql protocol requires // +build appengine build tag. I am not sure this build tag is enabled for Standard 2nd environment.

@cn007b
Copy link
Contributor Author

cn007b commented Sep 4, 2019

From documentation:

standard
sql.Open("mysql", fmt.Sprintf("%s:%s@cloudsql(%s)/", user, password, connectionName))

flexible
MYSQL_CONNECTION: user:password@unix(/cloudsql/INSTANCE_CONNECTION_NAME)/dbname

@methane
Copy link
Member

methane commented Sep 4, 2019

standard
sql.Open("mysql", fmt.Sprintf("%s:%s@cloudsql(%s)/", user, password, connectionName))

It is Go 1.9. It's 1st gen. It will be die soon. (No new deply since 2019-10-01)

Go 1.11 and 1.12 are 2nd gen. It uses unix.
https://cloud.google.com/appengine/docs/standard/go111/using-cloud-sql

@cn007b
Copy link
Contributor Author

cn007b commented Sep 4, 2019

Yes, true, you're right! For 2nd gen:
dbURI := fmt.Sprintf("%s:%s@unix(%s/%s)/%s", user, password, socket, connectionName, dbName).
I'll update standard 2nd gen example.

@methane
Copy link
Member

methane commented Sep 4, 2019

I'll update standard 2nd gen example.

Please unify 2nd gen example and flexible example if they are same.

@cn007b
Copy link
Contributor Author

cn007b commented Sep 4, 2019

Does it look better?

Copy link
Member

@methane methane left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, but travis fail blocks merging this.

@cn007b
Copy link
Contributor Author

cn007b commented Sep 4, 2019

Is it possible to me to do something with travis?

@methane
Copy link
Member

methane commented Sep 4, 2019

No. I already made PR to fix it but I can not merge it. Only another maintainer can help.

This project needs at least two active maintainers to go forward. Sorry.

@julienschmidt
Copy link
Member

@cn007b could you please rebase your changes onto the current upstream master?
It contains a fix for the macOS builds now.

@cn007b
Copy link
Contributor Author

cn007b commented Sep 4, 2019

Done.

@julienschmidt julienschmidt merged commit 23821f4 into go-sql-driver:master Sep 4, 2019
@julienschmidt julienschmidt added this to the v1.5.0 milestone Sep 4, 2019
tz70s pushed a commit to tz70s/mysql that referenced this pull request Sep 5, 2020
* Added GCP connection string example for flexible environment.

* Added one more GCP connection string example for flexible environment.

* Unified GCP connection strings examples for 2nd gen and flexible env.
tz70s pushed a commit to tz70s/mysql that referenced this pull request Sep 5, 2020
* Added GCP connection string example for flexible environment.

* Added one more GCP connection string example for flexible environment.

* Unified GCP connection strings examples for 2nd gen and flexible env.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants