2
0

Deprecate CheckConn in favor of Ping

This commit is contained in:
Jack Christensen
2023-06-03 18:54:58 -05:00
committed by Jack Christensen
parent 26c79eb215
commit 3ea2f57d8b
4 changed files with 67 additions and 20 deletions
+2 -4
View File
@@ -382,11 +382,9 @@ func quoteIdentifier(s string) string {
return `"` + strings.ReplaceAll(s, `"`, `""`) + `"`
}
// Ping executes an empty sql statement against the *Conn
// If the sql returns without error, the database Ping is considered successful, otherwise, the error is returned.
// Ping delegates to the underlying *pgconn.PgConn.Ping.
func (c *Conn) Ping(ctx context.Context) error {
_, err := c.Exec(ctx, ";")
return err
return c.pgConn.Ping(ctx)
}
// PgConn returns the underlying *pgconn.PgConn. This is an escape hatch method that allows lower level access to the