From 1f2d304cb62c8295ccaed308a7ed3582072d0f3d Mon Sep 17 00:00:00 2001 From: TommyLemon Date: Sun, 22 Dec 2024 20:17:51 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E6=94=AF=E6=8C=81=20Apache/I?= =?UTF-8?q?oTDB=20-=20=E4=B8=80=E4=BD=93=E5=8C=96=E6=94=B6=E9=9B=86?= =?UTF-8?q?=E3=80=81=E5=AD=98=E5=82=A8=E3=80=81=E7=AE=A1=E7=90=86=E4=B8=8E?= =?UTF-8?q?=E5=88=86=E6=9E=90=E7=89=A9=E8=81=94=E7=BD=91=E6=97=B6=E5=BA=8F?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E7=9A=84=E8=BD=AF=E4=BB=B6=E7=B3=BB=E7=BB=9F?= =?UTF-8?q?=EF=BC=9B=E5=AE=8C=E5=96=84=20AI=20=E5=90=91=E9=87=8F=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E5=BA=93=20Milvus=20=E7=9A=84=20SQL=20=E5=87=BD?= =?UTF-8?q?=E6=95=B0=E6=B3=A8=E5=86=8C=EF=BC=9B=E5=8D=87=E7=BA=A7=E7=89=88?= =?UTF-8?q?=E6=9C=AC=E6=94=AF=207.2.0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- APIJSONORM/pom.xml | 2 +- APIJSONORM/src/main/java/apijson/Log.java | 2 +- .../java/apijson/orm/AbstractSQLConfig.java | 29 +++++++++++++++++-- .../src/main/java/apijson/orm/SQLConfig.java | 6 +++- 4 files changed, 33 insertions(+), 6 deletions(-) diff --git a/APIJSONORM/pom.xml b/APIJSONORM/pom.xml index a0a31fa9..ada599ad 100644 --- a/APIJSONORM/pom.xml +++ b/APIJSONORM/pom.xml @@ -5,7 +5,7 @@ com.github.Tencent APIJSON - 7.1.0 + 7.2.0 jar APIJSONORM diff --git a/APIJSONORM/src/main/java/apijson/Log.java b/APIJSONORM/src/main/java/apijson/Log.java index 73c91316..2b6e28d9 100755 --- a/APIJSONORM/src/main/java/apijson/Log.java +++ b/APIJSONORM/src/main/java/apijson/Log.java @@ -14,7 +14,7 @@ public class Log { public static boolean DEBUG = true; - public static final String VERSION = "7.1.0"; + public static final String VERSION = "7.2.0"; public static final String KEY_SYSTEM_INFO_DIVIDER = "\n---|-----APIJSON SYSTEM INFO-----|---\n"; public static final String OS_NAME; diff --git a/APIJSONORM/src/main/java/apijson/orm/AbstractSQLConfig.java b/APIJSONORM/src/main/java/apijson/orm/AbstractSQLConfig.java index 4bbd6f57..11192f07 100755 --- a/APIJSONORM/src/main/java/apijson/orm/AbstractSQLConfig.java +++ b/APIJSONORM/src/main/java/apijson/orm/AbstractSQLConfig.java @@ -216,6 +216,7 @@ public abstract class AbstractSQLConfig implements SQLConfig implements SQLConfig(); // 保证顺序,避免配置冲突等意外情况 RAW_MAP.put("+", ""); @@ -820,6 +822,18 @@ public abstract class AbstractSQLConfig implements SQLConfig parser; @@ -1011,7 +1025,7 @@ public AbstractSQLConfig setMethod(RequestMethod method) { } @Override public boolean isPrepared() { - return prepared; + return prepared && ! isMongoDB(); // MongoDB JDBC 还不支持预编译; } @Override public AbstractSQLConfig setPrepared(boolean prepared) { @@ -1269,6 +1283,15 @@ public static boolean isTDengine(String db) { return DATABASE_TDENGINE.equals(db); } + + public boolean isIoTDB() { + return isIoTDB(getDatabase()); + } + public static boolean isIoTDB(String db) { + return DATABASE_IOTDB.equals(db); + } + + @Override public boolean isRedis() { return isRedis(getSQLDatabase()); @@ -1310,8 +1333,8 @@ public static boolean isSQLite(String db) { } @Override - public String getQuote() { - if(isElasticsearch()) { + public String getQuote() { // MongoDB 同时支持 `tbl` 反引号 和 "col" 双引号 + if(isElasticsearch() || isIoTDB()) { return ""; } return isMySQL() || isMariaDB() || isTiDB() || isClickHouse() || isTDengine() || isMilvus() ? "`" : "\""; diff --git a/APIJSONORM/src/main/java/apijson/orm/SQLConfig.java b/APIJSONORM/src/main/java/apijson/orm/SQLConfig.java index 7ed6cf66..08ba8613 100755 --- a/APIJSONORM/src/main/java/apijson/orm/SQLConfig.java +++ b/APIJSONORM/src/main/java/apijson/orm/SQLConfig.java @@ -37,12 +37,15 @@ public interface SQLConfig { String DATABASE_MILVUS = "MILVUS"; // https://milvus.io String DATABASE_INFLUXDB = "INFLUXDB"; // https://www.influxdata.com/products/influxdb-overview String DATABASE_TDENGINE = "TDENGINE"; // https://tdengine.com + String DATABASE_IOTDB = "IOTDB"; // https://iotdb.apache.org/zh/UserGuide/latest/API/Programming-JDBC.html + String DATABASE_REDIS = "REDIS"; // https://redisql.com String DATABASE_MONGODB = "MONGODB"; // https://www.mongodb.com/docs/atlas/data-federation/query/query-with-sql String DATABASE_KAFKA = "KAFKA"; // https://github.com/APIJSON/APIJSON-Demo/tree/master/APIJSON-Java-Server/APIJSONDemo-MultiDataSource-Kafka - String DATABASE_MQ = "MQ"; // String DATABASE_SQLITE = "SQLITE"; // https://www.sqlite.org + String DATABASE_MQ = "MQ"; // + String SCHEMA_INFORMATION = "information_schema"; //MySQL, PostgreSQL, SQL Server 都有的系统模式 String SCHEMA_SYS = "sys"; //SQL Server 系统模式 String TABLE_SCHEMA = "table_schema"; @@ -88,6 +91,7 @@ public interface SQLConfig { boolean isMilvus(); boolean isInfluxDB(); boolean isTDengine(); + boolean isIoTDB(); boolean isRedis(); boolean isMongoDB(); boolean isKafka();