Total Complexity | 2 |
Total Lines | 27 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 0 |
1 | 1 | import abc |
|
2 | 1 | from typing import Any |
|
3 | |||
4 | |||
5 | 1 | class PgSqlConnector: |
|
6 | """ |
||
7 | Interface for classes for connecting to a PostgreSQL instances. |
||
8 | """ |
||
9 | |||
10 | # ------------------------------------------------------------------------------------------------------------------ |
||
11 | 1 | @abc.abstractmethod |
|
12 | 1 | def connect(self) -> Any: |
|
13 | """ |
||
14 | Connects to a PostgreSQL instance. |
||
15 | |||
16 | :rtype: psycopg2.extensions.connection |
||
17 | """ |
||
18 | raise NotImplementedError() |
||
19 | |||
20 | # ------------------------------------------------------------------------------------------------------------------ |
||
21 | 1 | @abc.abstractmethod |
|
22 | 1 | def disconnect(self) -> None: |
|
23 | """ |
||
24 | Disconnects from a PostgreSQL instance. |
||
25 | """ |
||
26 | raise NotImplementedError() |
||
27 | |||
29 |