This is a general question about all python database drivers, but if you answer a specific driver (pyodbc, psycopg2, pymysql, mysqldb, etc.), it will still be useful.
As soon as I have a connection and a cursor, is there a way (API) to check the connection, whether or not has a timeout, without trying to execute the command in this way without reading / writing through the socket?
source share