Added comments to database

This commit is contained in:
Sven Heidemann 2021-03-14 16:27:06 +01:00
parent 268d56c348
commit 51cec3062d
2 changed files with 13 additions and 5 deletions

View File

@ -26,9 +26,6 @@ class DatabaseContext(DatabaseContextABC):
def session(self) -> Session: def session(self) -> Session:
return self._db.session return self._db.session
def create(self):
pass
def connect(self, connection_string: str): def connect(self, connection_string: str):
self._db.connect(connection_string) self._db.connect(connection_string)
self._create_tables() self._create_tables()

View File

@ -15,7 +15,18 @@ class DatabaseContextABC(ABC):
def session(self) -> Session: pass def session(self) -> Session: pass
@abstractmethod @abstractmethod
def connect(self, connection_string: str): pass def connect(self, connection_string: str):
"""
Connects to a database with connection string
:param connection_string:
:return:
"""
pass
@abstractmethod @abstractmethod
def _create_tables(self): pass def _create_tables(self):
"""
Create all tables for application from database model
:return:
"""
pass