diff --git a/redshift_connector/core.py b/redshift_connector/core.py index 3c12530..a0d7fb0 100644 --- a/redshift_connector/core.py +++ b/redshift_connector/core.py @@ -1385,6 +1385,15 @@ def close(self: "Connection") -> None: self._usock.close() self._sock = None # type: ignore + def is_closed(self: "Connection") -> bool: + """Returns if the connection instance is closed. + + Returns + ------- + bool:bool + """ + return self._sock is None + def handle_AUTHENTICATION_REQUEST(self: "Connection", data: bytes, cursor: Cursor) -> None: """ Handler for AuthenticationRequest message received via Amazon Redshift wire protocol, represented by