isConnectionValid method

  1. @override
bool isConnectionValid(
  1. PostgreSQLConnectionWrapper connection, {
  2. bool checkUsage = true,
})
override

Returns true if connection is valid for usage.

Implementation

@override
bool isConnectionValid(PostgreSQLConnectionWrapper connection,
    {bool checkUsage = true}) {
  if (connection.isClosed) return false;

  if (checkUsage && connection.isInactive(connectionInactivityLimit)) {
    return false;
  }

  return true;
}