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

Add ConnectWithDialer #643

Merged
merged 3 commits into from
Nov 19, 2021
Merged

Add ConnectWithDialer #643

merged 3 commits into from
Nov 19, 2021

Conversation

bakins
Copy link
Contributor

@bakins bakins commented Nov 10, 2021

We need more control over how dialing is done - in particular, integrating directly with https://pkg.go.dev/github.com/GoogleCloudPlatform/cloudsql-proxy/proxy/proxy

@@ -55,10 +56,23 @@ func getNetProto(addr string) string {
func Connect(addr string, user string, password string, dbName string, options ...func(*Conn)) (*Conn, error) {
proto := getNetProto(addr)

ctx, cancel := context.WithTimeout(context.Background(), time.Second*10)
Copy link
Member

Choose a reason for hiding this comment

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

Use 10*time.Second, please :)

But, LGTM.

Copy link
Collaborator

@lance6716 lance6716 left a comment

Choose a reason for hiding this comment

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

also lgtm

@atercattus we can change it to your style after this PR merged :P

@atercattus atercattus merged commit 958aa76 into go-mysql-org:master Nov 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants