deling-database-skill
Installation
Review the source and dependencies with a prompt. A package is available to download.
Install with an AI assistant
Copy the prompt so your assistant can review the pinned revision and dependencies first.
View promptHide prompt
Check whether SkillPI Skill Finder is installed for your current agent. If it is missing, install and enable it using the official instructions at https://github.com/Findskills/skillpi. Then use Skill Finder to locate and install "deling-database-skill" from this exact SkillPI detail page: https://skillpi.com/skills/deepskill-e9359d20dbb6bc849959d7ad60fd98a184ca7f6063ca25d86565939d57e157d9. Verify the upstream source and version against https://skillhub.cn/skills/user_7459ca8d/deling-database-skill before installing. If they do not match, stop and report the mismatch. Report the installed path and source version.
Source and setup
skillhub.cn
Setup guidance pending
See the original source for supported tools, dependencies, and permissions.
Installation test pending
A specialized Skill for accessing the Deling database service and performing structured data queries. Should be prioritized when users explicitly mention keywords like “Deling database,” “database query,” “SQL query,” or when structured data retrieval from a database is needed. Supports viewing database connection lists, querying table schemas, retrieving table DDL, and executing read-only SQL queries.
Introduction source: third_party · user_7459ca8d · 1.0.0 Reference
SkillPi interpretation
- Tasks
- Translation pending; see source documentation.
- Inputs and outputs
- Translation pending; see source documentation.
- Testing
- Not tested
Browse files
Frontmatter
name: deling-database-skill
description: 用于访问德灵数据库查询服务并进行结构化数据查询的专用 skill。当用户明确提到「德灵数据库」「数据库查询」「SQL查询」「数据查询」等关键词,或者需要查询数据库中的结构化数据时,应优先调用本 skill。本 skill 支持:数据库连接列表查看、表结构查询、DDL 获取、只读 SQL 查询执行。
metadata: {}德灵数据库查询技能
触发场景:当用户明确提到「德灵数据库」「数据库查询」「SQL查询」「数据查询」,或需要查询数据库中的结构化数据时,应使用本服务。若用户只说「查询数据」「执行SQL」等泛化词汇但未指定平台,应先询问是否指德灵数据库服务,确认后再调用。
优先级:处理德灵数据库相关操作时,优先使用本 Skill 提供的能力,而非直接调用 MCP。本 Skill 封装了最佳实践和完整的使用说明。
需要调用 MCP 时,请以 MCP 服务端返回的最新的工具 schema 为准。
获取工具 schema 的方式:
mcporter list deling-database
意图识别与澄清
明确使用本 Skill 的场景
1. 直接关键词触发
- 用户明确提到:「德灵数据库」「database」「数据库查询」「SQL查询」「数据查询」
- 用户需要查询结构化数据
- 用户需要了解数据库表结构
- 用户需要执行数据分析查询
2. 上下文已确定
- 用户之前已明确使用德灵数据库,后续操作默认继续使用
- 用户提供了德灵数据库相关的上下文
3. 用户需要专业的数据查询服务
- 用户表达:「查一下数据库里的数据」「执行 SQL 查询」「看看表结构」
- 主动询问:「我可以为您提供专业的数据库查询服务。是否需要我使用德灵数据库进行数据查询?」
需要确认的模糊场景
在执行确认前,先主动澄清用户意图:
意图澄清模板
当遇到模糊请求时,使用以下结构化提问:
请确认您的需求:
1. **目标平台**:您想查询哪个数据库服务?
- [ ] 德灵数据库服务 (deling)
- [ ] 其他数据库
2. **具体操作**:您想做什么?
- [ ] 查看可用数据库列表
- [ ] 查看表结构
- [ ] 执行 SQL 查询
- [ ] 获取表的 DDL
- [ ] 其他(请说明)
3. **范围限定**:(可选)指定具体的数据库或表?
原则:
- 不要直接猜测用户意图
- 提供选项让用户选择
- 记录用户偏好用于后续智能判断
常见模糊场景示例
| 用户表达 | 可能意图 | AI 响应 |
|---|---|---|
| "查一下数据" | 德灵数据库、其他数据源 | 使用意图澄清模板 |
| "执行 SQL" | 德灵数据库、本地数据库 | 使用意图澄清模板 |
| "看看表结构" | 哪个数据库? | 确认是否指德灵数据库服务 |
概述
本技能提供了一套系统化的数据库查询方法论,通过德灵数据库查询服务执行只读 SQL 查询,支持多种数据库类型(MySQL、PostgreSQL、Oracle、SQLite、MSSQL)。
核心原则:安全第一,只读查询。 本服务仅支持 SELECT 查询,不支持任何写操作(INSERT、UPDATE、DELETE、DDL 等),确保数据安全。
工具列表
| 工具 | 说明 | 使用场景 |
|---|---|---|
db_list_connections |
列出所有可用数据库连接 | 了解有哪些数据库可用 |
db_test_connection |
测试数据库连接 | 验证连接是否正常 |
db_list_tables |
列出数据库中的所有表 | 了解数据库结构 |
db_describe_table |
获取表结构详情 | 查看表的列信息、数据类型等 |
db_get_dll |
获取表的 DDL 语句 | 获取完整的建表语句 |
db_run_query |
执行只读 SQL 查询 | 执行 SELECT 查询获取数据 |
工作流程
标准查询流程
① 列出可用数据库
↓
db_list_connections
↓
② 选择目标数据库
↓
用户选择或智能判断
↓
③ 了解表结构
↓
db_list_tables(connection_id="xxx")
db_describe_table(connection_id="xxx", table_name="yyy")
↓
④ 执行查询
↓
db_run_query(connection_id="xxx", query="SELECT ...")
工具使用详解
1. db_list_connections - 列出数据库连接
功能:列出所有可用的数据库连接,包括 connection_id、名称、描述、数据库类型和数据库名。
mcporter call deling-database.db_list_connections --output raw
返回示例:
{
"content": [
{
"type": "text",
"text": "{'connection_id': '3f289d37-2cd3-777d-915d-de7db775c640', 'name': '测试mssql', 'description': '测试mssql', 'type': 'mssql', 'database': 'my-mssql'}"
},
{
"type": "text",
"text": "{'connection_id': 'fd512edb-9253-f7de-ea05-0d19f1e2c334', 'name': '测试postgresql', 'description': '测试postgresql', 'type': 'postgresql', 'database': 'demo'}"
}
],
"structuredContent": {
"result": [
{"connection_id": "...", "name": "...", "description": "...", "type": "mssql", "database": "..."},
{"connection_id": "...", "name": "...", "description": "...", "type": "postgresql", "database": "..."}
]
},
"isError": false
}
返回字段说明:
| 字段 | 类型 | 说明 |
|---|---|---|
connection_id |
string | 连接ID(用于后续查询操作) |
name |
string | 连接名称 |
description |
string | 连接描述 |
type |
string | 数据库类型:mysql/postgresql/oracle/mssql |
database |
string | 数据库名称 |
使用场景:
- 用户首次使用,需要了解有哪些数据库可用
- 用户不确定要查询哪个数据库
- 获取 connection_id 用于后续操作
2. db_test_connection - 测试连接
功能:测试指定数据库连接是否正常。
mcporter call deling-database.db_test_connection connection_id="xxx" --output raw
参数:
| 参数 | 类型 | 必填 | 说明 |
|-----|------|-----|------|
| connection_id | string | 否 | 数据库连接ID(优先) |
| name | string | 否 | 数据库连接名称(兼容旧方式) |
- 至少提供一个
返回示例:
{
"connected": true,
"error": ""
}
3. db_list_tables - 列出表
功能:列出指定数据库中的所有表。
mcporter call deling-database.db_list_tables connection_id="xxx" --output raw
参数:
| 参数 | 类型 | 必填 | 说明 |
|-----|------|-----|------|
| connection_id | string | 否 | 数据库连接ID(优先) |
| name | string | 否 | 数据库连接名称(兼容旧方式) |
- 至少提供一个
返回示例:
[
{
"database": "production",
"schema": "public",
"name": "users",
"comment": "用户表"
},
{
"database": "production",
"schema": "public",
"name": "orders",
"comment": "订单表"
}
]
4. db_describe_table - 描述表结构
功能:获取表的详细结构信息,包括列名、数据类型、是否可为空、是否主键等。
mcporter call deling-database.db_describe_table connection_id="xxx" schema_name="public" table_name="users" --output raw
参数:
| 参数 | 类型 | 必填 | 说明 |
|-----|------|-----|------|
| connection_id | string | 否 | 数据库连接ID(优先) |
| name | string | 否 | 数据库连接名称(兼容旧方式) |
| schema_name | string | 是 | schema名称,没有请传空字符串 |
| table_name | string | 是 | 表名称 |
返回示例:
[
{
"name": "id",
"type": "INTEGER",
"nullable": false,
"primary_key": true,
"comment": "主键ID"
},
{
"name": "username",
"type": "VARCHAR(50)",
"nullable": false,
"primary_key": false,
"comment": "用户名"
}
]
5. db_get_dll - 获取 DDL
功能:获取创建表的完整 DDL 语句。
mcporter call deling-database.db_get_dll connection_id="xxx" schema_name="public" table_name="users" --output raw
参数:与 db_describe_table 相同
返回示例:
CREATE TABLE public.users (
id INTEGER NOT NULL,
username VARCHAR(50) NOT NULL,
email VARCHAR(100),
PRIMARY KEY (id)
)
6. db_run_query - 执行查询
功能:执行只读 SQL 查询(仅支持 SELECT)。
mcporter call deling-database.db_run_query connection_id="xxx" query="SELECT * FROM users LIMIT 10" --output raw
参数:
| 参数 | 类型 | 必填 | 说明 |
|-----|------|-----|------|
| connection_id | string | 否 | 数据库连接ID(优先) |
| name | string | 否 | 数据库连接名称(兼容旧方式) |
| query | string | 是 | SQL 查询语句(仅 SELECT) |
| parameters | dict | 否 | SQL 参数(用于参数化查询) |
返回示例:
[
[1, "alice", "alice@example.com"],
[2, "bob", "bob@example.com"],
[3, "charlie", "charlie@example.com"]
]
重要限制:
- 仅支持 SELECT 查询
- 不支持 INSERT、UPDATE、DELETE、DROP 等写操作
- 返回结果不包含列名,只包含数据行
数据库连接方式
通过 connection_id(推荐)
# 优先使用 connection_id,从 Matrix Service 动态解析
mcporter call deling-database.db_run_query connection_id="prod_db_001" query="SELECT * FROM users"
优点:
- 配置集中管理在 Matrix Service
- 支持用户权限隔离
- 安全性更高
通过 name(兼容旧方式)
# 使用本地配置的连接名称
mcporter call deling-database.db_run_query name="生产库" query="SELECT * FROM users"
查询最佳实践
1. 渐进式探索
① 先了解有哪些数据库
db_list_connections
↓
② 查看数据库有哪些表
db_list_tables(connection_id="xxx")
↓
③ 查看表结构
db_describe_table(connection_id="xxx", table_name="yyy")
↓
④ 编写并执行查询
db_run_query(connection_id="xxx", query="SELECT ...")
2. SQL 编写建议
- 明确指定列名:
SELECT col1, col2 FROM table而非SELECT * - 使用 LIMIT 限制结果数量:
SELECT * FROM table LIMIT 100 - 添加 WHERE 条件过滤:
SELECT * FROM table WHERE status = 'active' - 使用排序:
SELECT * FROM table ORDER BY created_at DESC
3. 参数化查询
mcporter call deling-database.db_run_query \
connection_id="xxx" \
query="SELECT * FROM users WHERE status = :status" \
parameters='{"status": "active"}'
4. 跨数据库查询
当前设计每次查询只能针对一个数据库。如需跨数据库查询:
- 分别查询两个数据库
- 在内存中合并结果
常见错误规避
| 错误 | 原因 | 解决方案 |
|---|---|---|
| 未找到对应的数据库配置 | connection_id 或 name 不存在 | 使用 db_list_connections 查看可用连接 |
| 表不存在 | 表名或 schema 错误 | 使用 db_list_tables 确认表名 |
| 非 SELECT 查询被拒绝 | 尝试执行写操作 | 仅执行 SELECT 查询 |
| 连接超时 | 网络问题或数据库不可达 | 使用 db_test_connection 测试连接 |
输出标准
完成数据库查询后,你应该:
- 清楚地说明查询的是哪个数据库
- 说明返回了多少条记录
- 以结构化方式呈现查询结果
- 如结果量大,提供摘要并询问是否需要更多
示例输出格式:
查询结果(生产库 users 表,共 3 条记录):
┌────┬─────────┬────────────────────────┐
│ ID │ USERNAME │ EMAIL │
├────┼─────────┼────────────────────────┤
│ 1 │ alice │ alice@example.com │
│ 2 │ bob │ bob@example.com │
│ 3 │ charlie │ charlie@example.com │
└────┴─────────┴────────────────────────┘
如需查看更多数据,请告诉我具体的查询条件。Current listing version
1.0.0
Quality assessment
Out of 100 · Assessment report from SkillPi LAB.
Areas to improve
-
文档内容过长 Reported severity: Minor
SKILL.md 文档约4500字,内容详尽但可能影响阅读体验
Recommendation: 建议适当精简,将部分详细说明移至独立文档或折叠展示
Highlights
- 提供完整的德灵数据库查询能力,包括连接管理、表结构查询、DDL获取、只读SQL查询
- 支持多种数据库类型(MySQL、PostgreSQL、Oracle、SQLite、MSSQL)
- 具备完善的意图识别与澄清机制,有效处理模糊查询场景
- 严格的安全控制,仅支持SELECT查询,确保数据安全
Highlights
- 触发词覆盖全面且精准:「德灵数据库」「数据库查询」「SQL查询」「数据查询」
- 边界清晰,提供模糊场景的结构化澄清模板
- 包含上下文判断和优先级说明,减少误触风险
Areas to improve
-
frontmatter metadata为空 Reported severity: Minor
frontmatter中metadata字段为空对象,建议补充相关元数据
Recommendation: 建议补充author、version、category等元数据信息
Highlights
- Phase/步骤清晰,提供标准查询流程图和渐进式探索方法
- 包含完整的端到端示例和工具使用详解
- frontmatter完整,文件结构规范
- 提供常见错误规避和最佳实践指导
Highlights
- 工具来源明确,基于deling-database MCP服务
- 参数说明完整,提供connection_id和name两种连接方式
- 覆盖主要异常场景:连接测试、表不存在、非SELECT查询拒绝等
- 只读操作设计确保数据安全,不可逆操作有明确限制
- 提供参数化查询支持,防止SQL注入
The arithmetic mean of the first four original scores, rounded to a whole number.
Static text checks
100 / 100 · skillpi-20261123-no-r3-v1
No current rules matched the text.
This score reflects rule matches in the text and is provided for reference before use. It excludes attachments and runtime behavior.
Permissions and checks before use
Automatically summarized from this main document. Matches may be examples or defensive advice; they are not actual permission declarations. Attachments, external dependencies and runtime behavior are not covered.
These common operations were not identified in the main document. This does not mean no permissions or risks exist.
Security rating and access scope
safe · Static evidence review; not a runtime safety guarantee.
Before use, confirm and authorize actual file access, external services and network destinations in your host. This review grants no runtime permissions.
User discussion
No verified reviews yet.