2021.4.1 #11
@ -12,6 +12,10 @@ from cpl.database.database_settings import DatabaseSettings
|
|||||||
class DatabaseConnection(DatabaseConnectionABC):
|
class DatabaseConnection(DatabaseConnectionABC):
|
||||||
|
|
||||||
def __init__(self, database_settings: DatabaseSettings):
|
def __init__(self, database_settings: DatabaseSettings):
|
||||||
|
"""
|
||||||
|
Represents an connection to a database
|
||||||
|
:param database_settings:
|
||||||
|
"""
|
||||||
DatabaseConnectionABC.__init__(self)
|
DatabaseConnectionABC.__init__(self)
|
||||||
|
|
||||||
self._db_settings = database_settings
|
self._db_settings = database_settings
|
||||||
|
@ -18,4 +18,10 @@ class DatabaseConnectionABC(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 by connection string
|
||||||
|
:param connection_string:
|
||||||
|
:return:
|
||||||
|
"""
|
||||||
|
pass
|
||||||
|
Loading…
Reference in New Issue
Block a user