更新前端编译代码

This commit is contained in:
inrgihc
2024-10-08 21:31:52 +08:00
parent 4dbcd2cd80
commit 8e71a0fba6
26 changed files with 69 additions and 131 deletions

View File

@@ -56,6 +56,7 @@
├── dbswitch-product-mongodb // -> mongodb方言实现类 ├── dbswitch-product-mongodb // -> mongodb方言实现类
├── dbswitch-product-elasticsearch // -> elasticsearch方言实现类 ├── dbswitch-product-elasticsearch // -> elasticsearch方言实现类
├── dbswitch-product-starrocks // -> starrocks方言实现类 ├── dbswitch-product-starrocks // -> starrocks方言实现类
├── dbswitch-product-doris // -> doris方言实现类
├── dbswitch-data // 工具入口模块,读取配置文件中的参数执行异构迁移同步 ├── dbswitch-data // 工具入口模块,读取配置文件中的参数执行异构迁移同步
├── dbswitch-admin // 在以上模块的基础上引入Quartz的调度服务与接口 ├── dbswitch-admin // 在以上模块的基础上引入Quartz的调度服务与接口
├── dbswitch-admin-ui // 基于Vue2的前段WEB交互页面 ├── dbswitch-admin-ui // 基于Vue2的前段WEB交互页面
@@ -137,6 +138,7 @@ dbswitch:
source: source:
# source database connection information # source database connection information
## support multiple source database connection ## support multiple source database connection
type: ORACLE
url: jdbc:oracle:thin:@172.17.2.10:1521:ORCL url: jdbc:oracle:thin:@172.17.2.10:1521:ORCL
driver-class-name: 'oracle.jdbc.driver.OracleDriver' driver-class-name: 'oracle.jdbc.driver.OracleDriver'
driver-path: D:/Workspace/dbswitch/driver/oracle/oracle-12c driver-path: D:/Workspace/dbswitch/driver/oracle/oracle-12c
@@ -163,6 +165,7 @@ dbswitch:
target: target:
# target database connection information # target database connection information
## Best support for Oracle/PostgreSQL/Greenplum/DM(But not is Hive) etc. ## Best support for Oracle/PostgreSQL/Greenplum/DM(But not is Hive) etc.
type: POSTGRESQL
url: jdbc:postgresql://172.17.2.10:5432/test url: jdbc:postgresql://172.17.2.10:5432/test
driver-class-name: org.postgresql.Driver driver-class-name: org.postgresql.Driver
driver-path: D:/Workspace/dbswitch/driver/postgresql/postgresql-11.4 driver-path: D:/Workspace/dbswitch/driver/postgresql/postgresql-11.4
@@ -189,6 +192,7 @@ dbswitch:
| 配置参数 | 配置说明 | 示例 | 备注 | | 配置参数 | 配置说明 | 示例 | 备注 |
| :------| :------ | :------ | :------ | | :------| :------ | :------ | :------ |
| dbswitch.source.url | 来源端JDBC连接的URL | jdbc:oracle:thin:@10.17.1.158:1521:ORCL | 可为oracle/mysql/mariadb/sqlserver/postgresql/db2/dm/kingbase8/highgo | | dbswitch.source.url | 来源端JDBC连接的URL | jdbc:oracle:thin:@10.17.1.158:1521:ORCL | 可为oracle/mysql/mariadb/sqlserver/postgresql/db2/dm/kingbase8/highgo |
| dbswitch.source.type | 来源端数据库类型 | ORACLE | 对应数据库的类型枚举值 |
| dbswitch.source.driver-class-name | 来源端数据库的驱动类名称 | oracle.jdbc.driver.OracleDriver | 对应数据库的驱动类 | | dbswitch.source.driver-class-name | 来源端数据库的驱动类名称 | oracle.jdbc.driver.OracleDriver | 对应数据库的驱动类 |
| dbswitch.source.driver-path | 来源端数据库的驱动JAR所在目录 | D:/Workspace/dbswitch/driver/oracle/oracle-12c | 对应数据库的驱动JAR所在目录 | | dbswitch.source.driver-path | 来源端数据库的驱动JAR所在目录 | D:/Workspace/dbswitch/driver/oracle/oracle-12c | 对应数据库的驱动JAR所在目录 |
| dbswitch.source.username | 来源端连接帐号名 | test | 无 | | dbswitch.source.username | 来源端连接帐号名 | test | 无 |
@@ -201,6 +205,7 @@ dbswitch:
| dbswitch.source.regex-table-mapper | 基于正则表达式的表名称映射关系 | [{"from-pattern": "^","to-value": "T_"}] | 为list类型元素存在顺序关系 | | dbswitch.source.regex-table-mapper | 基于正则表达式的表名称映射关系 | [{"from-pattern": "^","to-value": "T_"}] | 为list类型元素存在顺序关系 |
| dbswitch.source.regex-column-mapper | 基于正则表达式的字段名映射关系 | [{"from-pattern": "$","to-value": "_x"}] | 为list类型元素存在顺序关系 | | dbswitch.source.regex-column-mapper | 基于正则表达式的字段名映射关系 | [{"from-pattern": "$","to-value": "_x"}] | 为list类型元素存在顺序关系 |
| dbswitch.target.url | 目的端JDBC连接的URL | jdbc:postgresql://10.17.1.90:5432/study | 可为oracle/sqlserver/postgresql/greenplum,mysql/mariadb/db2/dm/kingbase8/highgo也支持但字段类型兼容性问题比较多 | | dbswitch.target.url | 目的端JDBC连接的URL | jdbc:postgresql://10.17.1.90:5432/study | 可为oracle/sqlserver/postgresql/greenplum,mysql/mariadb/db2/dm/kingbase8/highgo也支持但字段类型兼容性问题比较多 |
| dbswitch.target.type | 目的端数据库类型 | POSTGRESQL | 对应数据库的类型枚举值 |
| dbswitch.target.driver-class-name |目的端数据库的驱动类名称 | org.postgresql.Driver | 对应数据库的驱动类 | | dbswitch.target.driver-class-name |目的端数据库的驱动类名称 | org.postgresql.Driver | 对应数据库的驱动类 |
| dbswitch.target.driver-path | 目的端数据库的驱动JAR所在目录 | D:/Workspace/dbswitch/driver/postgresql/postgresql-11.4 | 对应数据库的驱动JAR所在目录 | | dbswitch.target.driver-path | 目的端数据库的驱动JAR所在目录 | D:/Workspace/dbswitch/driver/postgresql/postgresql-11.4 | 对应数据库的驱动JAR所在目录 |
| dbswitch.target.username | 目的端连接帐号名 | test | 无 | | dbswitch.target.username | 目的端连接帐号名 | test | 无 |

View File

@@ -62,7 +62,7 @@
</li> </li>
<li>PostgreSQL <li>PostgreSQL
</li> </li>
<li>Greenplum(需使用PostgreSQL类型) <li>Greenplum
</li> </li>
<li>IBM的DB2 <li>IBM的DB2
</li> </li>
@@ -88,6 +88,8 @@
</li> </li>
<li>StarRocks <li>StarRocks
</li> </li>
<li>Doris
</li>
<li>MongoDB(只支持数据加载写入不支持变化量同步) <li>MongoDB(只支持数据加载写入不支持变化量同步)
</li> </li>
<li>ElasticSearch(只支持数据加载写入不支持变化量同步) <li>ElasticSearch(只支持数据加载写入不支持变化量同步)
@@ -130,7 +132,9 @@
dbswitch-product-hive // -> hive方言实现类 dbswitch-product-hive // -> hive方言实现类
dbswitch-product-sqlite // -> sqlite方言实现类 dbswitch-product-sqlite // -> sqlite方言实现类
dbswitch-product-clickhouse // -> clickhouse方言实现类 dbswitch-product-clickhouse // -> clickhouse方言实现类
dbswitch-product-greenplum // -> greenplum方言实现类
dbswitch-product-starrocks // -> starrocks方言实现类 dbswitch-product-starrocks // -> starrocks方言实现类
dbswitch-product-doris // -> doris方言实现类
dbswitch-product-mongodb // -> mongodb方言实现类 dbswitch-product-mongodb // -> mongodb方言实现类
dbswitch-product-elasticsearch // -> elasticsearch方言实现类 dbswitch-product-elasticsearch // -> elasticsearch方言实现类
dbswitch-data // 工具入口模块,读取配置文件中的参数执行异构迁移同步 dbswitch-data // 工具入口模块,读取配置文件中的参数执行异构迁移同步

View File

@@ -1 +1 @@
<!DOCTYPE html><html><head><meta charset=utf-8><meta name=viewport content="width=device-width,initial-scale=1"><title>异构数据迁移工具</title><link href=/static/css/app.71708c749da33e7ce9abc4b25af2a0aa.css rel=stylesheet></head><body><div id=app></div><script type=text/javascript src=/static/js/manifest.8de72e1f2be064870cd4.js></script><script type=text/javascript src=/static/js/vendor.8200341f98478c8f7552.js></script><script type=text/javascript src=/static/js/app.36911b44fc7ed34e7641.js></script></body></html> <!DOCTYPE html><html><head><meta charset=utf-8><meta name=viewport content="width=device-width,initial-scale=1"><title>异构数据迁移工具</title><link href=/static/css/app.48fb2adc31db789f5ffbeccb7b71c011.css rel=stylesheet></head><body><div id=app></div><script type=text/javascript src=/static/js/manifest.92998aeb1477ccbdd2b0.js></script><script type=text/javascript src=/static/js/vendor.8200341f98478c8f7552.js></script><script type=text/javascript src=/static/js/app.36911b44fc7ed34e7641.js></script></body></html>

Binary file not shown.

After

Width:  |  Height:  |  Size: 59 KiB

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -1,2 +0,0 @@
!function(e){var n=window.webpackJsonp;window.webpackJsonp=function(r,f,o){for(var a,d,b,i=0,u=[];i<r.length;i++)d=r[i],c[d]&&u.push(c[d][0]),c[d]=0;for(a in f)Object.prototype.hasOwnProperty.call(f,a)&&(e[a]=f[a]);for(n&&n(r,f,o);u.length;)u.shift()();if(o)for(i=0;i<o.length;i++)b=t(t.s=o[i]);return b};var r={},c={25:0};function t(n){if(r[n])return r[n].exports;var c=r[n]={i:n,l:!1,exports:{}};return e[n].call(c.exports,c,c.exports,t),c.l=!0,c.exports}t.e=function(e){var n=c[e];if(0===n)return new Promise(function(e){e()});if(n)return n[2];var r=new Promise(function(r,t){n=c[e]=[r,t]});n[2]=r;var f=document.getElementsByTagName("head")[0],o=document.createElement("script");o.type="text/javascript",o.charset="utf-8",o.async=!0,o.timeout=12e4,t.nc&&o.setAttribute("nonce",t.nc),o.src=t.p+"static/js/"+e+"."+{0:"21b5a16716d253990bd1",1:"fed755dff73c923d7f16",2:"22e821ec8c9909429f09",3:"ef5e983cf9ad9dc27899",4:"f4d7f6cfff84a6ebe507",5:"de32c8bd9fcd7cba61b2",6:"d7f3aa182a9403e7c6f6",7:"2c3ef6028bafee6fbaca",8:"535ff4d6dbb1131433ea",9:"4590fe5acd44e077ba19",10:"1d1a99a89d92bca35121",11:"f1220d9f411fa31f402d",12:"f04608dc3d77cd7fb925",13:"522b8e9b509523953170",14:"5d055f12c2b831e53cd6",15:"9742967c21d37f7c493f",16:"3d8d1b4a2cf253b6dcec",17:"68d3bb07f9efaf16b653",18:"b6bf70f4f372e952d31f",19:"b1e6da86c8a7dcf8425b",20:"beeb2cdb187564a0c9fe",21:"5bf6235c9914a933db4d",22:"c4c6da570159683c5736"}[e]+".js";var a=setTimeout(d,12e4);function d(){o.onerror=o.onload=null,clearTimeout(a);var n=c[e];0!==n&&(n&&n[1](new Error("Loading chunk "+e+" failed.")),c[e]=void 0)}return o.onerror=o.onload=d,f.appendChild(o),r},t.m=e,t.c=r,t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:r})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,n){return Object.prototype.hasOwnProperty.call(e,n)},t.p="/",t.oe=function(e){throw console.error(e),e}}([]);
//# sourceMappingURL=manifest.8de72e1f2be064870cd4.js.map

View File

@@ -0,0 +1,2 @@
!function(e){var c=window.webpackJsonp;window.webpackJsonp=function(n,f,o){for(var a,d,i,u=0,b=[];u<n.length;u++)d=n[u],r[d]&&b.push(r[d][0]),r[d]=0;for(a in f)Object.prototype.hasOwnProperty.call(f,a)&&(e[a]=f[a]);for(c&&c(n,f,o);b.length;)b.shift()();if(o)for(u=0;u<o.length;u++)i=t(t.s=o[u]);return i};var n={},r={25:0};function t(c){if(n[c])return n[c].exports;var r=n[c]={i:c,l:!1,exports:{}};return e[c].call(r.exports,r,r.exports,t),r.l=!0,r.exports}t.e=function(e){var c=r[e];if(0===c)return new Promise(function(e){e()});if(c)return c[2];var n=new Promise(function(n,t){c=r[e]=[n,t]});c[2]=n;var f=document.getElementsByTagName("head")[0],o=document.createElement("script");o.type="text/javascript",o.charset="utf-8",o.async=!0,o.timeout=12e4,t.nc&&o.setAttribute("nonce",t.nc),o.src=t.p+"static/js/"+e+"."+{0:"537fee2b51442d58d28f",1:"fed755dff73c923d7f16",2:"22e821ec8c9909429f09",3:"ef5e983cf9ad9dc27899",4:"f7c0ea89f712c0335ac9",5:"de32c8bd9fcd7cba61b2",6:"d7f3aa182a9403e7c6f6",7:"2c3ef6028bafee6fbaca",8:"535ff4d6dbb1131433ea",9:"4590fe5acd44e077ba19",10:"1d1a99a89d92bca35121",11:"f1220d9f411fa31f402d",12:"f04608dc3d77cd7fb925",13:"522b8e9b509523953170",14:"5d055f12c2b831e53cd6",15:"9742967c21d37f7c493f",16:"3d8d1b4a2cf253b6dcec",17:"68d3bb07f9efaf16b653",18:"b6bf70f4f372e952d31f",19:"b1e6da86c8a7dcf8425b",20:"beeb2cdb187564a0c9fe",21:"5bf6235c9914a933db4d",22:"c4c6da570159683c5736"}[e]+".js";var a=setTimeout(d,12e4);function d(){o.onerror=o.onload=null,clearTimeout(a);var c=r[e];0!==c&&(c&&c[1](new Error("Loading chunk "+e+" failed.")),r[e]=void 0)}return o.onerror=o.onload=d,f.appendChild(o),n},t.m=e,t.c=n,t.d=function(e,c,n){t.o(e,c)||Object.defineProperty(e,c,{configurable:!1,enumerable:!0,get:n})},t.n=function(e){var c=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(c,"a",c),c},t.o=function(e,c){return Object.prototype.hasOwnProperty.call(e,c)},t.p="/",t.oe=function(e){throw console.error(e),e}}([]);
//# sourceMappingURL=manifest.92998aeb1477ccbdd2b0.js.map

View File

@@ -10,7 +10,6 @@
package com.gitee.dbswitch.common.type; package com.gitee.dbswitch.common.type;
import java.util.Arrays; import java.util.Arrays;
import java.util.Set;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Getter; import lombok.Getter;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
@@ -206,17 +205,14 @@ public enum ProductTypeEnum {
new String[]{"jdbc:postgresql://{host}[:{port}]/[{database}][\\?{params}]"}, new String[]{"jdbc:postgresql://{host}[:{port}]/[{database}][\\?{params}]"},
"jdbc:postgresql://127.0.0.1:5432/test"), "jdbc:postgresql://127.0.0.1:5432/test"),
/** /**
* DORIS数据库类型 * DORIS数据库类型
*/ */
DORIS(21, "`", "Doris", "com.mysql.jdbc.Driver", 9030, DORIS(21, "`", "Doris", "com.mysql.jdbc.Driver", 9030,
"/* ping */ SELECT 1", "/* ping */ SELECT 1",
"jdbc:mysql://", "jdbc:mysql://",
new String[]{"jdbc:mysql://{host}[:{port}]/[{database}][\\?{params}]"}, new String[]{"jdbc:mysql://{host}[:{port}]/[{database}][\\?{params}]"},
"jdbc:mysql://127.0.0.1:9030/test?useUnicode=true&characterEncoding=utf-8&useSSL=false&zeroDateTimeBehavior=convertToNull&serverTimezone=Asia/Shanghai&tinyInt1isBit=false&rewriteBatchedStatements=true&useCompression=true"), "jdbc:mysql://127.0.0.1:9030/test?useUnicode=true&characterEncoding=utf-8&useSSL=false&zeroDateTimeBehavior=convertToNull&serverTimezone=Asia/Shanghai&tinyInt1isBit=false&rewriteBatchedStatements=true&useCompression=true"),
; ;
@@ -325,11 +321,11 @@ public enum ProductTypeEnum {
} }
/** /**
* 是否为Doris数据库类型 * 是否拼接建表SQl时小括号在PK前面
* *
* @return boolean * @return boolean
*/ */
public boolean isDoris() { public boolean isParenthesisBefore() {
return this == DORIS; return this == DORIS;
} }
@@ -342,15 +338,6 @@ public enum ProductTypeEnum {
return this != MONGODB && this != ELASTICSEARCH; return this != MONGODB && this != ELASTICSEARCH;
} }
/**
* 是否为ClickHouse数据库类型
*
* @return boolean
*/
public boolean isClickHouse() {
return this == CLICKHOUSE;
}
/** /**
* 是否存在指定字符串名称的数据库类型 * 是否存在指定字符串名称的数据库类型
* *
@@ -391,22 +378,4 @@ public enum ProductTypeEnum {
return url.startsWith(prefix1); return url.startsWith(prefix1);
} }
public static ProductTypeEnum getProductType(String url) {
return getProductType(url, null);
}
public static ProductTypeEnum getProductType(String url, Set<ProductTypeEnum> excludes) {
if (null != url) {
for (ProductTypeEnum productType : ProductTypeEnum.values()) {
if (null != excludes && excludes.contains(productType)) {
continue;
}
if (url.startsWith(productType.getUrlPrefix())) {
return productType;
}
}
}
return null;
}
} }

View File

@@ -9,13 +9,10 @@
///////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////
package com.gitee.dbswitch.common.util; package com.gitee.dbswitch.common.util;
import com.gitee.dbswitch.common.type.ProductTypeEnum;
import java.sql.Connection; import java.sql.Connection;
import java.sql.PreparedStatement; import java.sql.PreparedStatement;
import java.sql.ResultSet; import java.sql.ResultSet;
import java.sql.SQLException; import java.sql.SQLException;
import java.util.HashMap;
import java.util.Map;
import javax.sql.DataSource; import javax.sql.DataSource;
import lombok.experimental.UtilityClass; import lombok.experimental.UtilityClass;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
@@ -29,50 +26,6 @@ import lombok.extern.slf4j.Slf4j;
@UtilityClass @UtilityClass
public final class DatabaseAwareUtils { public final class DatabaseAwareUtils {
private static final Map<String, ProductTypeEnum> productNameMap;
private static final Map<String, ProductTypeEnum> driverNameMap;
static {
productNameMap = new HashMap<>();
driverNameMap = new HashMap<>();
productNameMap.put("Microsoft SQL Server", ProductTypeEnum.SQLSERVER);
productNameMap.put("DM DBMS", ProductTypeEnum.DM);
productNameMap.put("KingbaseES", ProductTypeEnum.KINGBASE);
productNameMap.put("Apache Hive", ProductTypeEnum.HIVE);
productNameMap.put("MySQL", ProductTypeEnum.MYSQL);
productNameMap.put("MariaDB", ProductTypeEnum.MARIADB);
productNameMap.put("Oracle", ProductTypeEnum.ORACLE);
productNameMap.put("PostgreSQL", ProductTypeEnum.POSTGRESQL);
productNameMap.put("Greenplum", ProductTypeEnum.GREENPLUM);
productNameMap.put("Highgo", ProductTypeEnum.HIGHGO);
productNameMap.put("DB2 for Unix/Windows", ProductTypeEnum.DB2);
productNameMap.put("Hive", ProductTypeEnum.HIVE);
productNameMap.put("SQLite", ProductTypeEnum.SQLITE3);
productNameMap.put("OSCAR", ProductTypeEnum.OSCAR);
productNameMap.put("GBase", ProductTypeEnum.GBASE8A);
productNameMap.put("Adaptive Server Enterprise", ProductTypeEnum.SYBASE);
productNameMap.put("ClickHouse", ProductTypeEnum.CLICKHOUSE);
productNameMap.put("Mongo DB", ProductTypeEnum.MONGODB);
driverNameMap.put("MySQL Connector Java", ProductTypeEnum.MYSQL);
driverNameMap.put("MariaDB Connector/J", ProductTypeEnum.MARIADB);
driverNameMap.put("Oracle JDBC driver", ProductTypeEnum.ORACLE);
driverNameMap.put("PostgreSQL JDBC Driver", ProductTypeEnum.POSTGRESQL);
driverNameMap.put("Kingbase8 JDBC Driver", ProductTypeEnum.KINGBASE);
driverNameMap.put("IBM Data Server Driver for JDBC and SQLJ", ProductTypeEnum.DB2);
driverNameMap.put("dm.jdbc.driver.DmDriver", ProductTypeEnum.DM);
driverNameMap.put("Hive JDBC", ProductTypeEnum.HIVE);
driverNameMap.put("SQLite JDBC", ProductTypeEnum.SQLITE3);
driverNameMap.put("OSCAR JDBC DRIVER", ProductTypeEnum.OSCAR);
driverNameMap.put("GBase JDBC Driver", ProductTypeEnum.GBASE8A);
driverNameMap.put("jConnect (TM) for JDBC (TM)", ProductTypeEnum.SYBASE);
driverNameMap.put("ClickHouse JDBC Driver", ProductTypeEnum.CLICKHOUSE);
driverNameMap.put("MongoDB JDBC Driver", ProductTypeEnum.MONGODB);
driverNameMap.put("esJestDriver", ProductTypeEnum.ELASTICSEARCH);
}
/** /**
* 检查MySQL数据库表的存储引擎是否为Innodb * 检查MySQL数据库表的存储引擎是否为Innodb
* *

View File

@@ -53,8 +53,7 @@ public class TaskParamEntity {
*/ */
@NonNull @NonNull
private ProductTypeEnum oldProductType; private ProductTypeEnum oldProductType;
/** /**
* 新表的数据源 * 新表的数据源
*/ */

View File

@@ -104,7 +104,7 @@ public final class GenerateSqlUtils {
sb.append(provider.getFieldDefinition(v, pks, autoIncr, false, withRemarks)); sb.append(provider.getFieldDefinition(v, pks, autoIncr, false, withRemarks));
} }
if (type.isDoris()) { if (type.isParenthesisBefore()) {
sb.append(")"); sb.append(")");
provider.appendPrimaryKeyForCreateTableSql(sb, pks); provider.appendPrimaryKeyForCreateTableSql(sb, pks);
} else { } else {

View File

@@ -1,27 +1,26 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" <project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent> <parent>
<artifactId>dbswitch-product</artifactId> <artifactId>dbswitch-product</artifactId>
<groupId>com.gitee.dbswitch</groupId> <groupId>com.gitee.dbswitch</groupId>
<version>1.9.9</version> <version>1.9.9</version>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<artifactId>dbswitch-product-doris</artifactId> <artifactId>dbswitch-product-doris</artifactId>
<dependencies>
<dependency>
<groupId>com.gitee.dbswitch</groupId>
<artifactId>dbswitch-common</artifactId>
<version>${project.version}</version>
</dependency>
<dependencies> <dependency>
<dependency> <groupId>com.gitee.dbswitch</groupId>
<groupId>com.gitee.dbswitch</groupId> <artifactId>dbswitch-core</artifactId>
<artifactId>dbswitch-common</artifactId> <version>${project.version}</version>
<version>${project.version}</version> </dependency>
</dependency> </dependencies>
<dependency>
<groupId>com.gitee.dbswitch</groupId>
<artifactId>dbswitch-core</artifactId>
<version>${project.version}</version>
</dependency>
</dependencies>
</project> </project>

View File

@@ -27,6 +27,7 @@ public class DorisFactoryProvider extends AbstractFactoryProvider {
super(dataSource); super(dataSource);
} }
@Override
public ProductFeatures getProductFeatures() { public ProductFeatures getProductFeatures() {
return new DorisFeatures(); return new DorisFeatures();
} }

View File

@@ -13,6 +13,7 @@ import com.gitee.dbswitch.features.ProductFeatures;
public class DorisFeatures implements ProductFeatures { public class DorisFeatures implements ProductFeatures {
@Override
public int convertFetchSize(int fetchSize) { public int convertFetchSize(int fetchSize) {
return Integer.MIN_VALUE; return Integer.MIN_VALUE;
} }

View File

@@ -12,17 +12,24 @@ package com.gitee.dbswitch.product.doris;
import com.gitee.dbswitch.common.consts.Constants; import com.gitee.dbswitch.common.consts.Constants;
import com.gitee.dbswitch.provider.ProductFactoryProvider; import com.gitee.dbswitch.provider.ProductFactoryProvider;
import com.gitee.dbswitch.provider.meta.AbstractMetadataProvider; import com.gitee.dbswitch.provider.meta.AbstractMetadataProvider;
import com.gitee.dbswitch.schema.*; import com.gitee.dbswitch.schema.ColumnDescription;
import lombok.extern.slf4j.Slf4j; import com.gitee.dbswitch.schema.ColumnMetaData;
import org.apache.commons.collections4.CollectionUtils; import com.gitee.dbswitch.schema.IndexDescription;
import org.apache.commons.lang3.StringUtils; import com.gitee.dbswitch.schema.SourceProperties;
import com.gitee.dbswitch.schema.TableDescription;
import java.sql.*; import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Collections; import java.util.Collections;
import java.util.List; import java.util.List;
import java.util.Optional; import java.util.Optional;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
@Slf4j @Slf4j
public class DorisMetadataQueryProvider extends AbstractMetadataProvider { public class DorisMetadataQueryProvider extends AbstractMetadataProvider {
@@ -303,7 +310,7 @@ public class DorisMetadataQueryProvider extends AbstractMetadataProvider {
retval += "CHAR(" + newLength + ")"; retval += "CHAR(" + newLength + ")";
} else if (newLength < 65533) { } else if (newLength < 65533) {
retval += "VARCHAR(" + newLength + ")"; retval += "VARCHAR(" + newLength + ")";
} else { } else {
retval += "STRING"; retval += "STRING";
} }
break; break;
@@ -341,7 +348,6 @@ public class DorisMetadataQueryProvider extends AbstractMetadataProvider {
SourceProperties tblProperties) { SourceProperties tblProperties) {
if (CollectionUtils.isNotEmpty(primaryKeys)) { if (CollectionUtils.isNotEmpty(primaryKeys)) {
String primaryKeyAsString = getPrimaryKeyAsString(primaryKeys); String primaryKeyAsString = getPrimaryKeyAsString(primaryKeys);
// builder.append("ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin");
builder.append(" DISTRIBUTED BY HASH(").append(primaryKeyAsString).append(") BUCKETS AUTO"); builder.append(" DISTRIBUTED BY HASH(").append(primaryKeyAsString).append(") BUCKETS AUTO");
if (StringUtils.isNotBlank(tblComment)) { if (StringUtils.isNotBlank(tblComment)) {
builder.append(String.format(" COMMENT='%s' ", tblComment.replace("'", "\\'"))); builder.append(String.format(" COMMENT='%s' ", tblComment.replace("'", "\\'")));

View File

@@ -13,6 +13,7 @@ import com.gitee.dbswitch.features.ProductFeatures;
public class MysqlFeatures implements ProductFeatures { public class MysqlFeatures implements ProductFeatures {
@Override
public int convertFetchSize(int fetchSize) { public int convertFetchSize(int fetchSize) {
return Integer.MIN_VALUE; return Integer.MIN_VALUE;
} }