| 530 | } |
| 531 | |
| 532 | func (c *Conn) Ping(ctx context.Context) error { |
| 533 | if c.conn.IsClosed() { |
| 534 | return driver.ErrBadConn |
| 535 | } |
| 536 | |
| 537 | err := c.conn.Ping(ctx) |
| 538 | if err != nil { |
| 539 | // A Ping failure implies some sort of fatal state. The connection is almost certainly already closed by the |
| 540 | // failure, but manually close it just to be sure. |
| 541 | c.Close() |
| 542 | return driver.ErrBadConn |
| 543 | } |
| 544 | |
| 545 | return nil |
| 546 | } |
| 547 | |
| 548 | func (c *Conn) CheckNamedValue(*driver.NamedValue) error { |
| 549 | // Underlying pgx supports sql.Scanner and driver.Valuer interfaces natively. So everything can be passed through directly. |