|
@@ -21,13 +21,13 @@ class MSSQLHandler:
|
|
|
|
|
|
|
|
|
|
db_uri = sqlalchemy.engine.url.URL.create(
|
|
db_uri = sqlalchemy.engine.url.URL.create(
|
|
- cfg["SQL"]["SQL_DIALECT"],
|
|
|
|
- username=cfg["SQL"]["SQL_USER"],
|
|
|
|
- password=cfg["SQL"]["SQL_PASSWORD"],
|
|
|
|
- host=cfg["SQL"]["SQL_HOST"],
|
|
|
|
- port=cfg["SQL"]["SQL_PORT"],
|
|
|
|
- database=cfg["SQL"]["SQL_DATABASE_NAME"],
|
|
|
|
- query=dict(driver=cfg["SQL"]["SQL_DRIVER"])
|
|
|
|
|
|
+ cfg["MSSQL"]["MSSQL_DIALECT"],
|
|
|
|
+ username=cfg["MSSQL"]["MSSQL_USER"],
|
|
|
|
+ password=cfg["MSSQL"]["MSSQL_PASSWORD"],
|
|
|
|
+ host=cfg["MSSQL"]["MSSQL_HOST"],
|
|
|
|
+ port=cfg["MSSQL"]["MSSQL_PORT"],
|
|
|
|
+ database=cfg["MSSQL"]["MSSQL_DATABASE_NAME"],
|
|
|
|
+ query=dict(driver=cfg["MSSQL"]["MSSQL_DRIVER"])
|
|
)
|
|
)
|
|
|
|
|
|
self._engine = sqlalchemy.create_engine(db_uri)
|
|
self._engine = sqlalchemy.create_engine(db_uri)
|
|
@@ -182,17 +182,3 @@ class MSSQLHandler:
|
|
|
|
|
|
else:
|
|
else:
|
|
self._log.info("The table can't be dropped because it does not exist")
|
|
self._log.info("The table can't be dropped because it does not exist")
|
|
-
|
|
|
|
- def draw_er_diagram_from_db(self, diagram_path: str,
|
|
|
|
- schema: str = None,
|
|
|
|
- include_tables: list = None):
|
|
|
|
-
|
|
|
|
- diagram_dir = os.path.dirname(diagram_path)
|
|
|
|
- if diagram_dir != "":
|
|
|
|
- os.makedirs(diagram_dir, exist_ok=True)
|
|
|
|
-
|
|
|
|
- import eralchemy
|
|
|
|
- eralchemy.render_er(self._db_uri,
|
|
|
|
- diagram_path,
|
|
|
|
- schema=schema,
|
|
|
|
- include_tables=include_tables)
|
|
|