2021.4.1 #11

Merged
edraft merged 172 commits from 2021.04.01 into 2021.04 2021-03-21 20:04:24 +01: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