Skip to content

Commit fc60126

Browse files
authored
feat: added is_closed method to connection class
1 parent 64cbd54 commit fc60126

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

Diff for: redshift_connector/core.py

+9
Original file line numberDiff line numberDiff line change
@@ -1385,6 +1385,15 @@ def close(self: "Connection") -> None:
13851385
self._usock.close()
13861386
self._sock = None # type: ignore
13871387

1388+
def is_closed(self: "Connection") -> bool:
1389+
"""Returns if the connection instance is closed.
1390+
1391+
Returns
1392+
-------
1393+
bool:bool
1394+
"""
1395+
return self._sock is None
1396+
13881397
def handle_AUTHENTICATION_REQUEST(self: "Connection", data: bytes, cursor: Cursor) -> None:
13891398
"""
13901399
Handler for AuthenticationRequest message received via Amazon Redshift wire protocol, represented by

0 commit comments

Comments
 (0)