Skip to content

Commit

Permalink
crate: Ping: Commented on how Ping method works
Browse files Browse the repository at this point in the history
Signed-off-by: John Andersen <[email protected]>
  • Loading branch information
pdxjohnny committed Oct 1, 2017
1 parent fbfe7a1 commit f634f54
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions crate.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ func (c *CrateDriver) Open(crate_url string) (driver.Conn, error) {
return c, nil
}

// Ping checks if we can connect to the cluster by selecting its name
// from sys.cluster. If the select fails we return an error.
func (c *CrateDriver) Ping(ctx context.Context) error {
_, err := c.Exec("SELECT name FROM sys.cluster", nil)
if err != nil && strings.Contains(err.Error(), "dial tcp") {
Expand Down

0 comments on commit f634f54

Please sign in to comment.