diff --git a/pom.xml b/pom.xml index 7e3357dafb..db82b06709 100644 --- a/pom.xml +++ b/pom.xml @@ -30,7 +30,7 @@ 3.5.6 2.2.220 4.4.0 - 1.35.13 + 1.35.14 2.6.0 3.5.2 3.12.1 diff --git a/sdk/extensions/extensions-datasource/src/main/java/io/dataease/extensions/datasource/dto/DatasourceDTO.java b/sdk/extensions/extensions-datasource/src/main/java/io/dataease/extensions/datasource/dto/DatasourceDTO.java index 79af9509e6..9d22db96ec 100644 --- a/sdk/extensions/extensions-datasource/src/main/java/io/dataease/extensions/datasource/dto/DatasourceDTO.java +++ b/sdk/extensions/extensions-datasource/src/main/java/io/dataease/extensions/datasource/dto/DatasourceDTO.java @@ -14,10 +14,10 @@ public class DatasourceDTO implements Serializable { @Serial private static final long serialVersionUID = 1175287571828910222L; - @JsonSerialize(using= ToStringSerializer.class) + @JsonSerialize(using = ToStringSerializer.class) private Long id; - @JsonSerialize(using= ToStringSerializer.class) + @JsonSerialize(using = ToStringSerializer.class) private Long pid; /** * 数据源名称 @@ -73,10 +73,10 @@ public class DatasourceDTO implements Serializable { private TaskDTO syncSetting; private Integer editType; - private String nodeType; - private String action; - private String fileName; - private String size; + private String nodeType; + private String action; + private String fileName; + private String size; /** * 上次成功更新时间 */ @@ -91,4 +91,6 @@ public class DatasourceDTO implements Serializable { private String taskStatus; private Boolean enableDataFill; + + private int dsVersion = -1; } diff --git a/sdk/extensions/extensions-datasource/src/main/java/io/dataease/extensions/datasource/provider/Provider.java b/sdk/extensions/extensions-datasource/src/main/java/io/dataease/extensions/datasource/provider/Provider.java index 7319454e57..78c6075039 100644 --- a/sdk/extensions/extensions-datasource/src/main/java/io/dataease/extensions/datasource/provider/Provider.java +++ b/sdk/extensions/extensions-datasource/src/main/java/io/dataease/extensions/datasource/provider/Provider.java @@ -136,6 +136,10 @@ public abstract class Provider { try { DatasourceSchemaDTO value = dsMap.entrySet().iterator().next().getValue(); + // 获取数据库version + ConnectionObj connection = getConnection(value); + value.setDsVersion(connection.getConnection().getMetaData().getDatabaseMajorVersion()); + SqlParser parser = SqlParser.create(sql, SqlParser.Config.DEFAULT.withLex(Lex.JAVA)); SqlNode sqlNode = parser.parseStmt(); return sqlNode.toSqlString(getDialect(value)).toString(); @@ -218,7 +222,7 @@ public abstract class Provider { sqlDialect = RedshiftSqlDialect.DEFAULT; break; case ck: - sqlDialect = ClickHouseSqlDialect.DEFAULT; + sqlDialect = new ClickHouseSqlDialect(ClickHouseSqlDialect.DEFAULT_CONTEXT, coreDatasource.getDsVersion()); break; case h2: sqlDialect = H2SqlDialect.DEFAULT;