diff --git a/pilot/connections/manages/connection_manager.py b/pilot/connections/manages/connection_manager.py index 1e4ec826e..f7184858e 100644 --- a/pilot/connections/manages/connection_manager.py +++ b/pilot/connections/manages/connection_manager.py @@ -27,6 +27,14 @@ class ConnectManager: subclasses += self.get_all_subclasses(subclass) return subclasses + def get_all_completed_types(self): + chat_classes = self.get_all_subclasses(BaseConnect) + support_types = [] + for cls in chat_classes: + if cls.db_type: + support_types.append(DBType.of_db_type(cls.db_type)) + return support_types + def get_cls_by_dbtype(self, db_type): chat_classes = self.get_all_subclasses(BaseConnect) result = None diff --git a/pilot/openapi/api_v1/api_v1.py b/pilot/openapi/api_v1/api_v1.py index 39faa9be8..33e226468 100644 --- a/pilot/openapi/api_v1/api_v1.py +++ b/pilot/openapi/api_v1/api_v1.py @@ -110,13 +110,8 @@ async def db_connect_delete(db_name: str = None): @router.get("/v1/chat/db/support/type", response_model=Result[DbTypeInfo]) async def db_support_types(): - support_types = [ - DBType.Mysql, - DBType.MSSQL, - DBType.DuckDb, - DBType.SQLite, - DBType.Clickhouse, - ] + + support_types = CFG.LOCAL_DB_MANAGE.get_all_completed_types() db_type_infos = [] for type in support_types: db_type_infos.append(