qustavo / sqlhooks

Attach hooks to any database/sql driver
MIT License
652 stars 44 forks source link

fix: implement sql/driver.Pinger interface #57

Open wburningham opened 5 months ago

wburningham commented 5 months ago

The sql/driver.Pinger interface is an optional interface to implement. For drivers that do implement the interface, the Conn type needs to try to call through.

keegancsmith commented 3 months ago

Out of interest at Sourcegraph we work around this problem by wrapping the driver again and skipping over sqlhooks. https://github.com/sourcegraph/sourcegraph/blob/cab2c723c5600345a1714ee236ef726af40870b1/internal/database/dbconn/open.go#L89-L117