🐛 fix(ai): 修复多方言执行与 DDL 降级

- SQL 执行:移除 AI 工具和代码块预览中硬编码的 LIMIT 50
- 方言适配:按连接类型和自定义驱动别名生成只读 SQL 预览限流语句
- Oracle 兼容:Oracle、自定义 Oracle 和达梦改用 ROWNUM 语法限制行数
- 权限降级:获取表 DDL 失败时自动降级为字段元数据摘要
- 上下文优化:手动添加表结构上下文时复用同一套 DDL 降级逻辑
- 测试覆盖:新增 AI SQL 限流和表结构降级单元测试
Refs #418
This commit is contained in:
Syngnat
2026-04-28 14:03:48 +08:00
parent f5f87189df
commit 51675f9d05
8 changed files with 235 additions and 31 deletions

View File

@@ -192,7 +192,8 @@ export const buildPaginatedSelectSQL = (
}
switch (normalizedType) {
case 'oracle': {
case 'oracle':
case 'dameng': {
const orderedSql = `${base}${orderBy}`;
const upperBound = safeOffset + safeLimit;
if (safeOffset <= 0) {