diff --git a/backend/src/main/java/io/dataease/provider/ProviderFactory.java b/backend/src/main/java/io/dataease/provider/ProviderFactory.java index 42c6091bc6..448d0c86d6 100644 --- a/backend/src/main/java/io/dataease/provider/ProviderFactory.java +++ b/backend/src/main/java/io/dataease/provider/ProviderFactory.java @@ -37,6 +37,8 @@ public class ProviderFactory implements ApplicationContextAware { case mysql: case mariadb: case ds_doris: + case TiDB: + case StarRocks: return context.getBean("mysqlQuery", QueryProvider.class); case sqlServer: return context.getBean("sqlserverQuery", QueryProvider.class); diff --git a/backend/src/main/java/io/dataease/provider/datasource/JdbcProvider.java b/backend/src/main/java/io/dataease/provider/datasource/JdbcProvider.java index 4786df662f..3a92cebe16 100644 --- a/backend/src/main/java/io/dataease/provider/datasource/JdbcProvider.java +++ b/backend/src/main/java/io/dataease/provider/datasource/JdbcProvider.java @@ -229,6 +229,8 @@ public class JdbcProvider extends DatasourceProvider { case engine_doris: case ds_doris: case mariadb: + case TiDB: + case StarRocks: MysqlConfiguration mysqlConfiguration = new Gson().fromJson(datasourceRequest.getDatasource().getConfiguration(), MysqlConfiguration.class); return mysqlConfiguration.getDataBase(); case sqlServer: @@ -429,6 +431,8 @@ public class JdbcProvider extends DatasourceProvider { case engine_doris: case engine_mysql: case ds_doris: + case TiDB: + case StarRocks: MysqlConfiguration mysqlConfiguration = new Gson().fromJson(datasourceRequest.getDatasource().getConfiguration(), MysqlConfiguration.class); username = mysqlConfiguration.getUsername(); password = mysqlConfiguration.getPassword(); @@ -541,6 +545,8 @@ public class JdbcProvider extends DatasourceProvider { case engine_mysql: case engine_doris: case ds_doris: + case TiDB: + case StarRocks: MysqlConfiguration mysqlConfiguration = new Gson().fromJson(datasourceRequest.getDatasource().getConfiguration(), MysqlConfiguration.class); dataSource.setUrl(mysqlConfiguration.getJdbc()); dataSource.setDriverClassName(mysqlConfiguration.getDriver()); @@ -623,10 +629,12 @@ public class JdbcProvider extends DatasourceProvider { case mysql: case engine_mysql: case mariadb: + case TiDB: JdbcConfiguration jdbcConfiguration = new Gson().fromJson(datasourceRequest.getDatasource().getConfiguration(), JdbcConfiguration.class); return String.format("SELECT TABLE_NAME,TABLE_COMMENT FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = '%s' ;", jdbcConfiguration.getDataBase()); case engine_doris: case ds_doris: + case StarRocks: case hive: case impala: return "show tables"; @@ -679,6 +687,8 @@ public class JdbcProvider extends DatasourceProvider { case engine_mysql: case ds_doris: case ck: + case TiDB: + case StarRocks: return null; case sqlServer: SqlServerConfiguration sqlServerConfiguration = new Gson().fromJson(datasourceRequest.getDatasource().getConfiguration(), SqlServerConfiguration.class); diff --git a/frontend/src/views/system/datasource/form.vue b/frontend/src/views/system/datasource/form.vue index 474166d736..1b93ca6c75 100644 --- a/frontend/src/views/system/datasource/form.vue +++ b/frontend/src/views/system/datasource/form.vue @@ -399,6 +399,7 @@ export default { }, allTypes: [ {name: 'mysql', label: 'MySQL', type: 'jdbc', extraParams: 'characterEncoding=UTF-8&connectTimeout=5000&useSSL=false&allowPublicKeyRetrieval=true'}, + {name: 'TiDB', label: 'TiDB', type: 'jdbc', extraParams: 'characterEncoding=UTF-8&connectTimeout=5000&useSSL=false&allowPublicKeyRetrieval=true'}, {name: 'hive', label: 'Apache Hive', type: 'jdbc', extraParams: ''}, {name: 'impala', label: 'Apache Impala', type: 'jdbc', extraParams: 'AuthMech=0'}, {name: 'oracle', label: 'Oracle', type: 'jdbc'}, @@ -406,6 +407,7 @@ export default { {name: 'pg', label: 'PostgreSQL', type: 'jdbc', extraParams: ''}, {name: 'es', label: 'Elasticsearch', type: 'es'}, {name: 'mariadb', label: 'MariaDB', type: 'jdbc', extraParams: 'characterEncoding=UTF-8&connectTimeout=5000&useSSL=false&allowPublicKeyRetrieval=true'}, + {name: 'StarRocks', label: 'StarRocks', type: 'jdbc', extraParams: 'characterEncoding=UTF-8&connectTimeout=5000&useSSL=false&allowPublicKeyRetrieval=true'}, {name: 'ds_doris', label: 'Doris', type: 'jdbc', extraParams: 'characterEncoding=UTF-8&connectTimeout=5000&useSSL=false&allowPublicKeyRetrieval=true'}, {name: 'ck', label: 'ClickHouse', type: 'jdbc', extraParams: ''}, {name: 'redshift', label: 'AWS Redshift', type: 'jdbc'},