Ver Fonte

feat: 增加TDengine数据库分页支持

fuyonghui há 2 anos atrás
pai
commit
07c31460ca

+ 7 - 1
mybatis-plus-annotation/src/main/java/com/baomidou/mybatisplus/annotation/DbType.java

@@ -176,7 +176,13 @@ public enum DbType {
     /**
      * openGauss
      */
-    OPENGAUSS("openGauss","华为 opengauss 数据库"),
+    OPENGAUSS("openGauss", "华为 opengauss 数据库"),
+
+    /**
+     * TDengine
+     */
+    TDENGINE("TDengine", "TDengine数据库"),
+
     /**
      * UNKONWN DB
      */

+ 3 - 2
mybatis-plus-extension/src/main/java/com/baomidou/mybatisplus/extension/plugins/pagination/DialectFactory.java

@@ -68,7 +68,8 @@ public class DialectFactory {
                 || dbType == DbType.HIGH_GO
                 || dbType == DbType.VERTICA
                 || dbType == DbType.REDSHIFT
-                || dbType ==DbType.OPENGAUSS ) {
+                || dbType == DbType.OPENGAUSS
+                || dbType == DbType.TDENGINE) {
                 dialect = new PostgreDialect();
             }
             // other types
@@ -86,7 +87,7 @@ public class DialectFactory {
                 dialect = new GBasedbtDialect();
             } else if (dbType == DbType.GBASE_INFORMIX) {
                 dialect = new GBaseInfromixDialect();
-            }else if (dbType == DbType.XCloud){
+            } else if (dbType == DbType.XCloud) {
                 dialect = new XCloudDialect();
             } else if (dbType == DbType.FIREBIRD) {
                 dialect = new FirebirdDialect();

+ 2 - 0
mybatis-plus-extension/src/main/java/com/baomidou/mybatisplus/extension/toolkit/JdbcUtils.java

@@ -129,6 +129,8 @@ public class JdbcUtils {
             return DbType.REDSHIFT;
         } else if (url.contains(":opengauss:")) {
             return DbType.OPENGAUSS;
+        } else if (url.contains(":TAOS:")) {
+            return DbType.TDENGINE;
         } else {
             logger.warn("The jdbcUrl is " + jdbcUrl + ", Mybatis Plus Cannot Read Database type or The Database's Not Supported!");
             return DbType.OTHER;