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

proposal: database/sql: add ConnetcionID() #31322

Closed
hanchuanchuan opened this issue Apr 7, 2019 · 3 comments
Closed

proposal: database/sql: add ConnetcionID() #31322

hanchuanchuan opened this issue Apr 7, 2019 · 3 comments
Labels
FrozenDueToAge Proposal WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.
Milestone

Comments

@hanchuanchuan
Copy link

hanchuanchuan commented Apr 7, 2019

When I create a connection, I want to get the connection ID, which may have been multiple times.
Is it possible to implement ConnectionID()?
Poor efficiency when using select connection_id() multiple times.

Go version go1.12.1 linux/amd64

@gopherbot gopherbot added this to the Proposal milestone Apr 7, 2019
@kardianos
Copy link
Contributor

Probably not. Either grab a DB.Conn and manually associate the ID once per connection, or wait for a potential conn.raw call.

@kardianos
Copy link
Contributor

Was this resolved?

@agnivade agnivade added the WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided. label Apr 8, 2019
@hanchuanchuan
Copy link
Author

Thanks! the problem has been solved!
When I found that a new connection is used, I will query the connection ID once.
go-sql-driver/mysql#946 (comment)

@agnivade agnivade closed this as completed Apr 9, 2019
@golang golang locked and limited conversation to collaborators Apr 8, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge Proposal WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.
Projects
None yet
Development

No branches or pull requests

4 participants