Merge pull request #11343 from dataease/pr@dev-v2@refactor_copilot

refactor(copilot): 优化engine
This commit is contained in:
Junjun 2024-08-02 16:31:27 +08:00 committed by GitHub
commit a56dd590db
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -114,7 +114,7 @@ public class CopilotManage {
}
DatasourceSchemaDTO ds = dsMap.entrySet().iterator().next().getValue();
String type = ds.getType();// 数据库类型如mysqloracle等可能需要映射成copilot需要的类型
String type = engine(ds.getType());// 数据库类型如mysqloracle等可能需要映射成copilot需要的类型
datasetDataManage.buildFieldName(sqlMap, allFields);
List<String> strings = transCreateTableFields(allFields);
@ -468,4 +468,19 @@ public class CopilotManage {
return copilotSQL;
}
}
private String engine(String type) {
switch (type) {
case "ck":
return "ClickHouse";
case "pg":
return "PostgreSQL";
case "mysql":
return "MySQL";
case "sqlServer":
return "SQL Server";
default:
return type;
}
}
}