Proposal: Add PDO::checkLiveness method

From: Date: Fri, 14 Aug 2020 18:16:00 +0000
Subject: Proposal: Add PDO::checkLiveness method
Groups: php.internals 
Request: Send a blank email to internals+get-111521@lists.php.net to get a copy of this message
Hey internals, I've submitted https://github.com/php/php-src/pull/5935 as a way to expose an underlying PDO driver's check_liveness function to userland scripts. Often advice given on the internet is to issue a no-op statement (e.g. SELECT 1 FROM dual), but this adds potentially unnecessary overhead and latency. Using the PDO driver's check_liveness function offers a lower-cost way of ensuring the connection is still alive. As noted in the PR, I am not tied to the method name, and open to any suggestions to making the PR better - I'm mostly interested in the underlying concept. It appears the test I added is currently failing for pgsql. I didn't have a test setup for that on hand but will look into it if there is positive feedback for this PR. Relatedly, I've also submitted https://github.com/php/php-src/pull/5947 as a way to potentially improve the mysqlnd driver's check_liveness function. Thanks! Eric Norris

« previous php.internals (#111521) next »