2021.4 #19

Merged
edraft merged 237 commits from 2021.4 into master 2021-04-01 10:13:33 +02:00
2 changed files with 13 additions and 5 deletions
Showing only changes of commit 51cec3062d - Show all commits

View File

@ -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()

View File

@ -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