import abc
from typing import Any
[docs]class PgSqlConnector:
"""
Interface for classes for connecting to a PostgreSQL instances.
"""
# ------------------------------------------------------------------------------------------------------------------
[docs] @abc.abstractmethod
def connect(self) -> Any:
"""
Connects to a PostgreSQL instance.
:rtype: psycopg2.extensions.connection
"""
raise NotImplementedError()
# ------------------------------------------------------------------------------------------------------------------
[docs] @abc.abstractmethod
def disconnect(self) -> None:
"""
Disconnects from a PostgreSQL instance.
"""
raise NotImplementedError()
# ----------------------------------------------------------------------------------------------------------------------