From ac141549222ff006273063fa2a5e6150062bcf0e Mon Sep 17 00:00:00 2001
From: TommyLemon <1184482681@qq.com>
Date: Sat, 14 Mar 2026 13:07:56 +0800
Subject: [PATCH 01/15] doc: Document.md add Chinese entrance
---
Document.md | 2 ++
1 file changed, 2 insertions(+)
diff --git a/Document.md b/Document.md
index 7574e569..d6929597 100644
--- a/Document.md
+++ b/Document.md
@@ -1,3 +1,5 @@
+## English | [中文](/blob/master/README-Chinese.md)
+
#### A better online document is available at https://apijsondocs.readthedocs.io
### Examples:
From 35805a72dde88ce417e7793961619fb9f7b0ffd8 Mon Sep 17 00:00:00 2001
From: TommyLemon <1184482681@qq.com>
Date: Sat, 14 Mar 2026 13:08:36 +0800
Subject: [PATCH 02/15] Update Document.md
---
Document.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Document.md b/Document.md
index d6929597..d3f18d4a 100644
--- a/Document.md
+++ b/Document.md
@@ -1,4 +1,4 @@
-## English | [中文](/blob/master/README-Chinese.md)
+## English | [中文](https://github.com/Tencent/APIJSON/blob/master/Document-Chinese.md)
#### A better online document is available at https://apijsondocs.readthedocs.io
From b591dc7318659864b70d139754ea199e8fe6faa8 Mon Sep 17 00:00:00 2001
From: TommyLemon <1184482681@qq.com>
Date: Sat, 14 Mar 2026 13:09:19 +0800
Subject: [PATCH 03/15] Update Document-Chinese.md
---
Document-Chinese.md | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/Document-Chinese.md b/Document-Chinese.md
index 11db6fe8..65caa417 100644
--- a/Document-Chinese.md
+++ b/Document-Chinese.md
@@ -1,5 +1,4 @@
-[English](https://github.com/Tencent/APIJSON/blob/master/Document-English.md)
-
+## 中文 | [English](https://github.com/Tencent/APIJSON/blob/master/Document-English.md)
# APIJSON 通用文档
本文是通用文档,只和 APIJSON 协议有关,和 C#, Go, Java, JavaScript, PHP, Python, TypeScript 等开发语言无关。
From 7a53f3be99f019e7e296acc213f753428d3fe679 Mon Sep 17 00:00:00 2001
From: TommyLemon <1184482681@qq.com>
Date: Sat, 14 Mar 2026 13:09:49 +0800
Subject: [PATCH 04/15] Update Document-Chinese.md
---
Document-Chinese.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Document-Chinese.md b/Document-Chinese.md
index 65caa417..ffe8e975 100644
--- a/Document-Chinese.md
+++ b/Document-Chinese.md
@@ -1,4 +1,4 @@
-## 中文 | [English](https://github.com/Tencent/APIJSON/blob/master/Document-English.md)
+## 中文 | [English](https://github.com/Tencent/APIJSON/blob/master/Document.md)
# APIJSON 通用文档
本文是通用文档,只和 APIJSON 协议有关,和 C#, Go, Java, JavaScript, PHP, Python, TypeScript 等开发语言无关。
From bd5151b60ab9b5194ea55607a10f5d09fe420d51 Mon Sep 17 00:00:00 2001
From: TommyLemon
Date: Sun, 29 Mar 2026 16:15:04 +0800
Subject: [PATCH 05/15] =?UTF-8?q?=E7=BB=93=E6=9E=9C=E9=9B=86=E5=AE=B9?=
=?UTF-8?q?=E9=87=8F=E9=A2=84=E4=BC=B0=EF=BC=9A=E6=9C=80=E4=BD=8E=E5=BC=80?=
=?UTF-8?q?=E5=90=AF=E9=98=88=E5=80=BC=E9=BB=98=E8=AE=A4=E8=AE=BE=E7=BD=AE?=
=?UTF-8?q?=E4=B8=BA=202^16=20-=201=20=3D=2065535=EF=BC=8CArrayList=20?=
=?UTF-8?q?=E6=9C=80=E5=A4=9A=E6=89=A9=E5=AE=B9=205=20=E6=AC=A1?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../src/main/java/apijson/orm/AbstractSQLExecutor.java | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/APIJSONORM/src/main/java/apijson/orm/AbstractSQLExecutor.java b/APIJSONORM/src/main/java/apijson/orm/AbstractSQLExecutor.java
index 8a2862eb..7870d3df 100755
--- a/APIJSONORM/src/main/java/apijson/orm/AbstractSQLExecutor.java
+++ b/APIJSONORM/src/main/java/apijson/orm/AbstractSQLExecutor.java
@@ -158,6 +158,8 @@ public ResultSet execute(@NotNull Statement statement, String sql) throws Except
return rs;
}
+ public static int MIN_OPTIMIZE_CAPACITY = 2^16 - 1;
+
/**执行SQL
* @param config
* @return
@@ -330,7 +332,7 @@ public M execute(@NotNull SQLConfig config, boolean unknownType) throws
}
else { // 预估容量
capacity = config.getCount() <= 0 ? AbstractParser.MAX_QUERY_COUNT : config.getCount();
- if (capacity > 100) {
+ if (capacity > MIN_OPTIMIZE_CAPACITY) {
// 有 WHERE 条件,条件越多过滤数据越多,暂时不考虑 @combine:"a | (b & !c)" 里面 | OR 和 ! NOT 条件,太复杂也不是很必要
Map> combine = config.getCombineMap();
@@ -354,14 +356,15 @@ public M execute(@NotNull SQLConfig config, boolean unknownType) throws
Map having = config.getHaving();
int havingCount = having == null ? 0 : having.size();
- capacity /= Math.pow(1.5, Math.log10(capacity)
+ double cap = capacity / Math.pow(1.5, Math.log10(capacity)
+ andCondCount
+ ((orCondCount <= 0 ? 0 : 2.0d/orCondCount) // 1: 2.3, 2: 1.5, 3: 1.3, 4: 1.23, 5: 1.18
+ (notCondCount/5.0d) // 1: 1.08, 2: 1.18, 3: 1.28, 4: 1.38, 1.50
+ (groupCount <= 0 ? 0 : 10.0d/groupCount)) // 1: 57.7, 7.6, 3: 3.9, 4: 2.8, 5: 2.3
+ havingCount
);
- capacity += 1; // 避免正好比需要容量少一点点导致多一次扩容,大量数据 System.arrayCopy
+ cap = Math.max(MIN_OPTIMIZE_CAPACITY, Math.max(cap, capacity/Math.pow(1.5, 5))); // 1/(1.5^5) = 0.13
+ capacity = (int) (cap + 1); // 避免正好比需要容量少一点点导致多一次扩容,大量数据 System.arrayCopy
}
}
}
From f63e2ad244bbcc8f8060c55d96274bad2f13fef6 Mon Sep 17 00:00:00 2001
From: TommyLemon
Date: Sun, 29 Mar 2026 16:28:54 +0800
Subject: [PATCH 06/15] =?UTF-8?q?=E7=BB=93=E6=9E=9C=E9=9B=86=E5=AE=B9?=
=?UTF-8?q?=E9=87=8F=E9=A2=84=E4=BC=B0=EF=BC=9A=E4=BC=98=E5=8C=96=20GROUP?=
=?UTF-8?q?=20BY=20=E5=87=8F=E5=B0=91=E5=88=9D=E5=A7=8B=E5=AE=B9=E9=87=8F?=
=?UTF-8?q?=E4=B8=8B=E9=99=90?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
APIJSONORM/src/main/java/apijson/orm/AbstractSQLExecutor.java | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/APIJSONORM/src/main/java/apijson/orm/AbstractSQLExecutor.java b/APIJSONORM/src/main/java/apijson/orm/AbstractSQLExecutor.java
index 7870d3df..bddfad26 100755
--- a/APIJSONORM/src/main/java/apijson/orm/AbstractSQLExecutor.java
+++ b/APIJSONORM/src/main/java/apijson/orm/AbstractSQLExecutor.java
@@ -360,10 +360,10 @@ public M execute(@NotNull SQLConfig config, boolean unknownType) throws
+ andCondCount
+ ((orCondCount <= 0 ? 0 : 2.0d/orCondCount) // 1: 2.3, 2: 1.5, 3: 1.3, 4: 1.23, 5: 1.18
+ (notCondCount/5.0d) // 1: 1.08, 2: 1.18, 3: 1.28, 4: 1.38, 1.50
- + (groupCount <= 0 ? 0 : 10.0d/groupCount)) // 1: 57.7, 7.6, 3: 3.9, 4: 2.8, 5: 2.3
+ + (groupCount <= 0 ? 0 : 10.0d/Math.min(5, groupCount))) // 1: 57.7, 7.6, 3: 3.9, 4: 2.8, 5: 2.3
+ havingCount
);
- cap = Math.max(MIN_OPTIMIZE_CAPACITY, Math.max(cap, capacity/Math.pow(1.5, 5))); // 1/(1.5^5) = 0.13
+ cap = groupCount > 0 ? cap : Math.max(MIN_OPTIMIZE_CAPACITY, Math.max(cap, capacity/Math.pow(1.5, 5))); // 1/(1.5^5) = 0.13
capacity = (int) (cap + 1); // 避免正好比需要容量少一点点导致多一次扩容,大量数据 System.arrayCopy
}
}
From 46c9f3be16e3ffcfbf75c71739438e9554549af3 Mon Sep 17 00:00:00 2001
From: TommyLemon
Date: Sun, 29 Mar 2026 17:04:32 +0800
Subject: [PATCH 07/15] =?UTF-8?q?=E7=BB=93=E6=9E=9C=E9=9B=86=E5=AE=B9?=
=?UTF-8?q?=E9=87=8F=E9=A2=84=E4=BC=B0=EF=BC=9ALIMIT=2010^9=20=3D=201=20?=
=?UTF-8?q?=E4=BA=BF=20=E4=BB=A5=E5=86=85=E6=97=A0=E4=BB=BB=E4=BD=95?=
=?UTF-8?q?=E6=9D=A1=E4=BB=B6=E6=97=B6=20=E6=9C=80=E5=A4=9A=E6=89=A9?=
=?UTF-8?q?=E5=AE=B9=201=20=E6=AC=A1?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
APIJSONORM/src/main/java/apijson/orm/AbstractSQLExecutor.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/APIJSONORM/src/main/java/apijson/orm/AbstractSQLExecutor.java b/APIJSONORM/src/main/java/apijson/orm/AbstractSQLExecutor.java
index bddfad26..3107b905 100755
--- a/APIJSONORM/src/main/java/apijson/orm/AbstractSQLExecutor.java
+++ b/APIJSONORM/src/main/java/apijson/orm/AbstractSQLExecutor.java
@@ -356,7 +356,7 @@ public M execute(@NotNull SQLConfig config, boolean unknownType) throws
Map having = config.getHaving();
int havingCount = having == null ? 0 : having.size();
- double cap = capacity / Math.pow(1.5, Math.log10(capacity)
+ double cap = capacity / Math.pow(1.5, Math.log10(capacity)/8 // LIMIT 10^9 = 1 亿 以内无任何条件时 最多扩容 1 次
+ andCondCount
+ ((orCondCount <= 0 ? 0 : 2.0d/orCondCount) // 1: 2.3, 2: 1.5, 3: 1.3, 4: 1.23, 5: 1.18
+ (notCondCount/5.0d) // 1: 1.08, 2: 1.18, 3: 1.28, 4: 1.38, 1.50
From 696656a530fff2c12ce50c393f50ff6997d723b0 Mon Sep 17 00:00:00 2001
From: TommyLemon
Date: Sun, 29 Mar 2026 17:07:27 +0800
Subject: [PATCH 08/15] =?UTF-8?q?=E5=8D=87=E7=BA=A7=E7=89=88=E6=9C=AC?=
=?UTF-8?q?=E4=B8=BA=208.1.5?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
APIJSONORM/pom.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/APIJSONORM/pom.xml b/APIJSONORM/pom.xml
index 8b36d0da..4ce8f9af 100644
--- a/APIJSONORM/pom.xml
+++ b/APIJSONORM/pom.xml
@@ -5,7 +5,7 @@
com.github.Tencent
APIJSON
- 8.1.3
+ 8.1.5
jar
APIJSONORM
From a303055f18124a6bd3143d38b8dbee747127ff3b Mon Sep 17 00:00:00 2001
From: TommyLemon <1184482681@qq.com>
Date: Sun, 29 Mar 2026 19:05:49 +0800
Subject: [PATCH 09/15] =?UTF-8?q?=20=E6=9B=BF=E6=8D=A2=20apijson-rust=20?=
=?UTF-8?q?=E9=93=BE=E6=8E=A5=EF=BC=9Ahttps://github.com/APIJSON/apijson-r?=
=?UTF-8?q?ust?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
创作不易,右上角点亮 ⭐Star 来支持/收藏下吧,谢谢 ^_^
https://github.com/APIJSON/apijson-rust
https://gitee.com/APIJSON/apijson-rust
---
README-Chinese.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/README-Chinese.md b/README-Chinese.md
index efd1858f..ceb1ef25 100644
--- a/README-Chinese.md
+++ b/README-Chinese.md
@@ -699,7 +699,7 @@ Issue/问卷 一般解答顺序:贡献者 > 帮助他人的用户 > 提供任
[uliweb-apijson](https://github.com/zhangchunlin/uliweb-apijson) Python 版 APIJSON,支持 MySQL, PostgreSQL, SQL Server, Oracle, SQLite 等
-[apijson-rust](https://gitee.com/APIJSON/panda-base) APIJSON 的 Rust 版,一个优雅、高性能的 Rust 多数据源管理系统,支持 MySQL 和 PostgreSQL
+[apijson-rust](https://github.com/APIJSON/apijson-rust) APIJSON 的 Rust 版,一个优雅、高性能的 Rust 多数据源管理系统,支持 MySQL 和 PostgreSQL
[APIJSONParser](https://github.com/Zerounary/APIJSONParser) 第三方 APIJSON 解析器,将 JSON 动态解析成 SQL
From d955657d1ffbb40b48be900d154d0c38e92c74f1 Mon Sep 17 00:00:00 2001
From: TommyLemon
Date: Sat, 18 Apr 2026 03:31:37 +0800
Subject: [PATCH 10/15] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E5=85=A8=E5=B1=80=20da?=
=?UTF-8?q?tasource,=20namespace,=20catalog=20=E6=9C=AA=E7=94=A8=E4=BA=8E?=
=?UTF-8?q?=E5=8F=82=E6=95=B0=E6=A0=A1=E9=AA=8C?=
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 +-
.../main/java/apijson/orm/AbstractParser.java | 18 ++-
.../java/apijson/orm/AbstractSQLConfig.java | 39 +++++--
.../java/apijson/orm/AbstractVerifier.java | 108 +++++++++++-------
.../src/main/java/apijson/orm/Verifier.java | 15 ++-
6 files changed, 118 insertions(+), 66 deletions(-)
diff --git a/APIJSONORM/pom.xml b/APIJSONORM/pom.xml
index 4ce8f9af..5f869837 100644
--- a/APIJSONORM/pom.xml
+++ b/APIJSONORM/pom.xml
@@ -5,7 +5,7 @@
com.github.Tencent
APIJSON
- 8.1.5
+ 8.1.6
jar
APIJSONORM
diff --git a/APIJSONORM/src/main/java/apijson/Log.java b/APIJSONORM/src/main/java/apijson/Log.java
index d301cdf0..5a4d2169 100755
--- a/APIJSONORM/src/main/java/apijson/Log.java
+++ b/APIJSONORM/src/main/java/apijson/Log.java
@@ -21,7 +21,7 @@ public class Log {
public static String LEVEL = LEVEL_WARN;
- public static final String VERSION = "8.1.5";
+ public static final String VERSION = "8.1.6";
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/AbstractParser.java b/APIJSONORM/src/main/java/apijson/orm/AbstractParser.java
index e2403122..44550abe 100755
--- a/APIJSONORM/src/main/java/apijson/orm/AbstractParser.java
+++ b/APIJSONORM/src/main/java/apijson/orm/AbstractParser.java
@@ -1516,10 +1516,10 @@ else if (childKeys.length == 1 && isTableKey(childKeys[0])) { // 可能无需
JOIN_COPY_KEY_LIST = new ArrayList();
JOIN_COPY_KEY_LIST.add(KEY_ROLE);
JOIN_COPY_KEY_LIST.add(KEY_DATABASE);
+ JOIN_COPY_KEY_LIST.add(KEY_DATASOURCE);
JOIN_COPY_KEY_LIST.add(KEY_NAMESPACE);
JOIN_COPY_KEY_LIST.add(KEY_CATALOG);
JOIN_COPY_KEY_LIST.add(KEY_SCHEMA);
- JOIN_COPY_KEY_LIST.add(KEY_DATASOURCE);
JOIN_COPY_KEY_LIST.add(KEY_COLUMN);
JOIN_COPY_KEY_LIST.add(KEY_NULL);
JOIN_COPY_KEY_LIST.add(KEY_CAST);
@@ -2382,9 +2382,11 @@ protected M batchVerify(RequestMethod method, String tag, int version, String na
}
switch (objAttrKey) {
+ case KEY_DATABASE:
case KEY_DATASOURCE:
+ case KEY_NAMESPACE:
+ case KEY_CATALOG:
case KEY_SCHEMA:
- case KEY_DATABASE:
case KEY_VERSION:
case KEY_ROLE:
objAttrMap.put(objAttrKey, entry.getValue());
@@ -2432,17 +2434,21 @@ protected M batchVerify(RequestMethod method, String tag, int version, String na
}
} else {
setRequestAttribute(key, true, KEY_METHOD, request);
+ setRequestAttribute(key, true, KEY_DATABASE, request);
setRequestAttribute(key, true, KEY_DATASOURCE, request);
+ setRequestAttribute(key, true, KEY_NAMESPACE, request);
+ setRequestAttribute(key, true, KEY_CATALOG, request);
setRequestAttribute(key, true, KEY_SCHEMA, request);
- setRequestAttribute(key, true, KEY_DATABASE, request);
setRequestAttribute(key, true, KEY_VERSION, request);
setRequestAttribute(key, true, KEY_ROLE, request);
}
} else {
setRequestAttribute(key, false, KEY_METHOD, request);
+ setRequestAttribute(key, false, KEY_DATABASE, request);
setRequestAttribute(key, false, KEY_DATASOURCE, request);
+ setRequestAttribute(key, false, KEY_NAMESPACE, request);
+ setRequestAttribute(key, false, KEY_CATALOG, request);
setRequestAttribute(key, false, KEY_SCHEMA, request);
- setRequestAttribute(key, false, KEY_DATABASE, request);
setRequestAttribute(key, false, KEY_VERSION, request);
setRequestAttribute(key, false, KEY_ROLE, request);
}
@@ -2569,7 +2575,9 @@ protected M objectVerify(RequestMethod method, String tag, int version, String n
// 获取指定的JSON结构 >>>>>>>>>>>>>>
M target = wrapRequest(method, tag, object, true);
// Map clone 浅拷贝没用,Structure.parse 会导致 structure 里面被清空,第二次从缓存里取到的就是 {}
- return getVerifier().setParser(this).verifyRequest(method, name, target, request, maxUpdateCount, getGlobalDatabase(), getGlobalSchema());
+ return getVerifier().setParser(this).verifyRequest(method, name, target, request, maxUpdateCount
+ , getGlobalDatabase(), getGlobalDatasource(), getGlobalNamespace(), getGlobalCatalog(), getGlobalSchema()
+ );
}
/***
diff --git a/APIJSONORM/src/main/java/apijson/orm/AbstractSQLConfig.java b/APIJSONORM/src/main/java/apijson/orm/AbstractSQLConfig.java
index d9e9eb01..c3532314 100755
--- a/APIJSONORM/src/main/java/apijson/orm/AbstractSQLConfig.java
+++ b/APIJSONORM/src/main/java/apijson/orm/AbstractSQLConfig.java
@@ -5490,7 +5490,7 @@ public static , L extends List