| 4 | from utils.utils import Hashing |
| 5 | |
| 6 | class DataBase: |
| 7 | def __init__(self, dbname:str, connectionsettings:Connection): |
| 8 | if connectionsettings is not None: |
| 9 | self.username = connectionsettings.username |
| 10 | self.password = connectionsettings.password |
| 11 | self.host = connectionsettings.server |
| 12 | |
| 13 | self._database = dbname.lower() if dbname else None |
| 14 | self._status_handler = None |
| 15 | self._hashcolumn = Settings.checksum_column |
| 16 | self._tables = [] |
| 17 | |
| 18 | @property |
| 19 | def principal_database(self)->str: |
| 20 | pass |
| 21 | |
| 22 | @property |
| 23 | def status_handler(self): |
| 24 | return self._status_handler |
| 25 | |
| 26 | @status_handler.setter |
| 27 | def status_handler(self, value): |
| 28 | self._status_handler = value |
| 29 | |
| 30 | def _get_columns(self, tablename:str): |
| 31 | pass |
| 32 | |
| 33 | def _get_columns_from_table(self, tablename:str): |
| 34 | pass |
| 35 | """ |
| 36 | Check if Table exists |
| 37 | """ |
| 38 | def check_exists_table(self, tablename:str) -> bool: |
| 39 | raise ModuleNotFoundError(f"{str(self)} Not implemented") |
| 40 | |
| 41 | """ |
| 42 | If database exists, drop and create |
| 43 | """ |
| 44 | def create_database(self, dbname:str): |
| 45 | raise ModuleNotFoundError(f"{str(self)} Not implemented") |
| 46 | |
| 47 | def create_table(self, name:str, columns=None): |
| 48 | raise ModuleNotFoundError(f"{str(self)} Not implemented") |
| 49 | |
| 50 | def create_columns(self, tablename:str, columns): |
| 51 | raise ModuleNotFoundError(f"{str(self)} Not implemented") |
| 52 | |
| 53 | def insert_data(self, tablename, data, columns=None): |
| 54 | raise ModuleNotFoundError(f"{str(self)} Not implemented") |
| 55 | |
| 56 | def insert_many(self, tablename, data, columns=None): |
| 57 | raise ModuleNotFoundError(f"{str(self)} Not implemented") |
| 58 | |
| 59 | def search_tables(self, filter:str) -> Result: |
| 60 | raise ModuleNotFoundError(f"{str(self)} Not implemented") |
| 61 | |
| 62 | def search_columns(self, filter:str) -> Result: |
| 63 | raise ModuleNotFoundError(f"{str(self)} Not implemented") |
nothing calls this directly
no outgoing calls
no test coverage detected