PgSqlConnector.disconnect()   A
last analyzed

Complexity

Conditions 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 3
nop 1
dl 0
loc 6
ccs 2
cts 2
cp 1
crap 1
rs 10
c 0
b 0
f 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
28
# ----------------------------------------------------------------------------------------------------------------------
29