Total Complexity | 2 |
Total Lines | 33 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | import abc |
||
2 | from typing import Any, Dict |
||
3 | |||
4 | |||
5 | class DataTypeHelper(metaclass=abc.ABCMeta): |
||
6 | """ |
||
7 | Utility class for deriving information based on a DBMS native data type. |
||
8 | """ |
||
9 | |||
10 | # ------------------------------------------------------------------------------------------------------------------ |
||
11 | @abc.abstractmethod |
||
12 | def column_type_to_python_type(self, data_type_info: Dict[str, Any]) -> str: |
||
13 | """ |
||
14 | Returns the corresponding Python data type of a DBMS native data type. |
||
15 | |||
16 | :param dict data_type_info: The DBMS native data type metadata. |
||
17 | |||
18 | :rtype: str |
||
19 | """ |
||
20 | raise NotImplementedError() |
||
21 | |||
22 | # ------------------------------------------------------------------------------------------------------------------ |
||
23 | @abc.abstractmethod |
||
24 | def column_type_to_python_type_hint(self, data_type_info: Dict[str, Any]) -> str: |
||
25 | """ |
||
26 | Returns the corresponding Python data type hint of a MySQL data type. |
||
27 | |||
28 | :param dict data_type_info: The MySQL data type metadata. |
||
29 | |||
30 | :rtype: str |
||
31 | """ |
||
32 | raise NotImplementedError() |
||
33 | |||
35 |