-
Notifications
You must be signed in to change notification settings - Fork 25
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
feat: Add ping ability #97
Conversation
examples/sql/counter/main.go
Outdated
defer tx.Rollback() | ||
defer func() { | ||
err := tx.Rollback() | ||
log.Fatal(err) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't it be:
if err != nil {
log.Fatal(err)
}
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah it should haha ill change that now
This adds the Ping only to websockets, no? |
4df1da5
to
11767af
Compare
Ah at first glance it didn't look like that had a diver but I guess it needs to be added to the hranaV2Conn |
Signed-off-by: Erik Westra <[email protected]>
Signed-off-by: Erik Westra <[email protected]>
Signed-off-by: Erik Westra <[email protected]>
11767af
to
05c9f06
Compare
Signed-off-by: Erik Westra <[email protected]>
ebee6c0
to
2903dd5
Compare
@haaawk Should be ready for re-review |
This PR adds a Ping and PingContext method to the Driver which satisfy the sql driver interface.
It uses a simple SELECT 1 to test the connection, which I believe is how most drivers implement a ping.
I have added a test to test the funcitonality and also included an example.
Closes #96