I do not think the library is a suitable place for such a thing.
If you use a connection pool, most likely you will ask it to check the connections before transferring them. You simply enter the appropriate SQL and let the pool process it. The library will be a step back because it means that your code will call it.
duffymo
source share