mirror of
https://github.com/infiniflow/ragflow.git
synced 2026-06-29 15:31:05 +08:00
Refact: update exesql notification (#14027)
### What problem does this PR solve? Refact: update exesql notification ### Type of change - [x] Refactoring
This commit is contained in:
@@ -255,6 +255,10 @@ class ExeSQL(ToolBase, ABC):
|
||||
if not single_sql:
|
||||
continue
|
||||
single_sql = re.sub(r"\[ID:[0-9]+\]", "", single_sql)
|
||||
if re.match(r"^(insert|update|delete)\b", single_sql, flags=re.IGNORECASE):
|
||||
sql_res.append({"content": "For security reasons, INSERT, UPDATE, and DELETE statements are not supported."})
|
||||
formalized_content.append("For security reasons, INSERT, UPDATE, and DELETE statements are not supported.")
|
||||
continue
|
||||
cursor.execute(single_sql)
|
||||
if cursor.rowcount == 0:
|
||||
sql_res.append({"content": "No record in the database!"})
|
||||
|
||||
Reference in New Issue
Block a user