From 51cec3062d32106b544d625b862e9f09c666d57c Mon Sep 17 00:00:00 2001 From: Sven Heidemann Date: Sun, 14 Mar 2021 16:27:06 +0100 Subject: [PATCH] Added comments to database --- src/cpl/database/context/database_context.py | 3 --- src/cpl/database/context/database_context_abc.py | 15 +++++++++++++-- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/src/cpl/database/context/database_context.py b/src/cpl/database/context/database_context.py index 22627552..fe77f013 100644 --- a/src/cpl/database/context/database_context.py +++ b/src/cpl/database/context/database_context.py @@ -26,9 +26,6 @@ class DatabaseContext(DatabaseContextABC): def session(self) -> Session: return self._db.session - def create(self): - pass - def connect(self, connection_string: str): self._db.connect(connection_string) self._create_tables() diff --git a/src/cpl/database/context/database_context_abc.py b/src/cpl/database/context/database_context_abc.py index f7542c80..4c4d5dca 100644 --- a/src/cpl/database/context/database_context_abc.py +++ b/src/cpl/database/context/database_context_abc.py @@ -15,7 +15,18 @@ class DatabaseContextABC(ABC): def session(self) -> Session: pass @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 - def _create_tables(self): pass + def _create_tables(self): + """ + Create all tables for application from database model + :return: + """ + pass