execute_sql
Run read-only SQL SELECT queries to perform advanced cross-field and cross-table searches in the SiYuan knowledge base, with sensitive data automatically masked.
Instructions
直接对数据库执行只读的 SELECT 查询。
适用场景: - 需要跨字段、跨表的高级筛选能力。 - 内置查询工具无法覆盖的复杂检索。
使用方法: - 仅支持 SELECT 语句。 - 建议显式 LIMIT,避免一次返回过多数据。
注意事项: - 返回的字符串字段会进行敏感信息打码。 - 如需精确审计原始敏感字段值,不适合使用该工具。
Args: query (str): SQL SELECT 查询语句
Returns: List[Dict[str, Any]]: 查询结果列表
Raises: ValueError: 如果查询不是 SELECT 语句
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |