fix: 查询模板占位符替换 + _auto_add_limit 跳过非SELECT语句 + 默认用户密码修正
修复:
- getTemplateSQL() 支持 {table}/{db}/{collection} 占位符自动替换
- _auto_add_limit() 仅对 SELECT 语句添加 LIMIT, SHOW/DESC/EXPLAIN 跳过
- seed_data 默认用户密码从 '***' 改为 'admin123'
- DB 中已有用户密码已重置为 admin123
测试: 75 passed (新增2个 SHOW/DESC LIMIT 测试)
This commit is contained in:
1 parent
0fb947dcb5
commit
0aa4595c90
4 files changed
+35
-9
No files matched your search
@@ -336,10 +336,10 @@ function NewQueryPanel({
|
||||
}, [templates, templateCategory, templateSearch]);
|
||||
|
||||
const handleApplyTemplate = useCallback((tpl: QueryTemplate) => {
|
||||
const templateSQL = getTemplateSQL(tpl, dbType);
|
||||
const templateSQL = getTemplateSQL(tpl, dbType, { db: database || undefined });
|
||||
setSql(templateSQL);
|
||||
setShowTemplates(false);
|
||||
}, [dbType]);
|
||||
}, [dbType, database]);
|
||||
|
||||
const handleExecute = useCallback(async () => {
|
||||
if (!sql || !instanceId) { setError('请选择实例并输入查询语句'); return; }
|
||||
|
||||
Reference in new issue
Block a user