ephraimbuddy commented on code in PR #50657:
URL: https://github.com/apache/airflow/pull/50657#discussion_r2099544689


##########
airflow-core/src/airflow/cli/commands/db_manager_command.py:
##########
@@ -18,33 +18,50 @@
 
 from airflow import settings
 from airflow.cli.commands.db_command import run_db_downgrade_command, 
run_db_migrate_command
-from airflow.providers.fab.auth_manager.models.db import _REVISION_HEADS_MAP, 
FABDBManager
+from airflow.configuration import conf
 from airflow.utils import cli as cli_utils
+from airflow.utils.module_loading import import_string
 from airflow.utils.providers_configuration_loader import 
providers_configuration_loaded
 
 
+def _get_db_manager(name):
+    """Import the db manager class."""
+    db_managers = conf.get("database", "external_db_managers")
+    db_manager = None
+    for manager in db_managers.split(","):
+        if name in manager:
+            db_manager = manager
+            break
+    if db_manager is None:
+        raise SystemExit(f"DB manager {name} not found in configuration.")
+    return import_string(db_manager.strip())

Review Comment:
   It might not be nice to have a command like:
   `airflow db-manager 
"airflow.providers.fab.auth_manager.models.db.FABDBManager" reset -y`
   or what do you think?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to