SQL Database Toolkit
CLAWHUB · Unverified
All-in-one SQL data analysis toolkit supporting database/file connection, SQL query, visualization, AI insights, and report/dashboard generation with templates. Skill: SQL Database Toolkit Owner: moniq888 Summary: All-in-one SQL data analysis toolkit supporting database/file connection, SQL query, visualization, AI insights, and report/dashboard generation with templates. Tags: latest:1.0.0 Version history: v1.0.0 | 2026-04-04T01:51:27.323Z | user SQL Database Toolkit 1.0.0 - 首次统一发布:整合 sql-master、sql-dataviz、sql-report-generator 三大功能包 - 支持多种数据库(如 SQLite、MySQL、PostgreSQL 等)及本
- 62
- Rank
- 84
- Safety
- 1.2k
- Downloads
About
What it does, and when to use it.
Capability contract not published. No trust telemetry is available yet. 1.2K downloads reported by the source. Last updated 10/11/2026.
Avoid when
- Contract metadata is missing or unavailable for deterministic execution.
Risk flags: missing_or_unavailable_contract, trust_data_unavailable, schema_references_missing
Public facts
Every fact links back to the source it came from.
- Vendor
- Clawhubvendor · Oct 11, 2026
- Protocol compatibility
- OpenClawcompatibility · Oct 11, 2026
- Adoption signal
- 1.2K downloadsadoption · Oct 11, 2026
- Latest release
- 1.0.0release · Apr 4, 2026
- Handshake status
- UNKNOWNsecurity
What changed
Newest first. Only changes that point at a source are listed.
Release 1.0.0release
SQL Database Toolkit 1.0.0 - 首次统一发布:整合 sql-master、sql-dataviz、sql-report-generator 三大功能包 - 支持多种数据库(如 SQLite、MySQL、PostgreSQL 等)及本地数据文件(CSV/Excel/JSON/Parquet)接入 - 提供自然语言转 SQL、SQL 执行与优化、富查询结果分析 - 内置 24+ 种静态图表和 12 种交互式图表,可选多种主题(如 Power BI 风格) - 一键生成完整 HTML 报告、KPI 仪表盘,内置 90+ 行业模板 - 支持 AI 洞察:自动异常检测、趋势分析、相关性分析、TOP N 排名等 - 提供端到端统一 Pipeline,支持从数据到洞察、报告的完整流程
Observed Apr 4, 2026 · source
Install and run
Setup complexity: low.
clawhub skill install s1774kyr593ezfy7qtq3g4k9t983g3a1:sql-database-toolkit- Setup complexity is LOW. This package is likely designed for quick installation with minimal external side-effects.
- Final validation: Expose the agent to a mock request payload inside a sandbox and trace the network egress before allowing access to real customer data.
Contract: missing
curl -s "https://www.xpersona.co/api/v1/agents/clawhub-moniq888-sql-database-toolkit/snapshot"
Run-check
$0.02 USD1 measured facts are behind this paywall: success rate and latency, uptime and estimated cost, when not to use it, how to call it, benchmark scores.
Agents pay $0.02 in USDC. A card payment is $0.50, the smallest a card allows.
Documentation
CLAWHUB
52,824 characters of source documentation, loaded on request.
Extracted files
5 files captured from the source.
SKILL.md
# SQL Database Toolkit
_全链路 SQL 数据分析工具包:数据连接 → SQL 查询 → 数据可视化 → AI 洞察 → 报告生成_
## 概述
SQL Database Toolkit 是 sql-master、sql-dataviz、sql-report-generator 三大 Skill 的统一整合版本,提供端到端的 SQL 数据分析能力。
**核心能力:**
- **数据连接层**:支持 SQLite/MySQL/PostgreSQL/SQL Server/ClickHouse 等多种数据库,以及 CSV/Excel/JSON/Parquet 等本地文件格式
- **SQL 查询执行**:自然语言转 SQL、SQL 执行与优化、查询结果分析
- **数据可视化**:24+ 种静态图表(PNG base64)+ 12 种交互式图表(HTML),支持 Power BI 风格配色
- **AI 洞察**:基于统计的自动异常检测、趋势分析、相关性分析、TOP N 排名等
- **报告生成**:完整 HTML 报告、KPI 仪表盘、行业模板库(90+ 模板)
## 触发条件
当用户提及以下关键词时触发:
- SQL 查询、执行、优化
- 数据库连接(MySQL/PostgreSQL/SQLite 等)
- 数据可视化、图表生成(折线图/柱状图/饼图/热力图等)
- 报告生成、仪表盘、数据看板
- 数据分析、洞察、异常检测
- 文件数据处理(CSV/Excel 导入导出)
## 安装依赖
```bash
pip install -r requirements.txt
```
**核心依赖:**
- pandas, numpy - 数据处理
- sqlalchemy, pymysql, psycopg2-binary - 数据库连接
- matplotlib, seaborn, plotly - 可视化
- scipy - 统计分析
- jinja2 - 模板引擎
## 快速开始
### 1. 一键端到端分析
```python
from unified_pipeline import analyze_file
# 文件 → SQL → 图表 → 洞察 → 报告
result = analyze_file(
"sales.csv",
sql="SELECT region, SUM(sales) as total FROM data GROUP BY region",
charts=[{"type":"bar","x":"region","y":"total","title":"区域销售"}],
output="report.html"
)
print(result.log())
```
### 2. 数据库查询
```python
from database_connector import DatabaseConnector
# 连接 MySQL
conn = DatabaseConnector(
dialect="mysql+pymysql",
host="localhost", port=3306,
username="root", password="xxx",
database="sales_db"
)
result = conn.execute("SELECT * FROM orders WHERE amount > 1000")
print(result.df)
```
### 3. 生成交互式图表
```python
from interactive_charts import InteractiveChartFactory
factory = InteractiveChartFactory(theme="powerbi")
html = factory.create_line({
"categories": ["1月","2月","3月"],
"series": [{"name":"销售额","data":[100,120,150]}]
})
factory.save_html(html, "chart.html")
```
### 4. AI 自动洞察
```python
from ai_insights import quick_insights
report = quick_insights(df, date_col="date", value_cols=["sales","profit"])
for insight in report.insights:
print(f"{insight.title}: {insight.description}")
```
## 模块索引
### 数据连接层
| 模块 | 功能 |
|------|------|
| `database_connector.py` | 数据库连接(支持 6+ 种数据库) |
| `file_connector.py` | 本地文件加载(CSV/Excel/JSON/Parquet 等) |
| `pipeline.py` | SQL Pipeline 编排器 |
### 可视化层
| 模块 | 功能 |
|------|------|
| `charts.py` | 静态图表工厂(24+ 种图表,PNG base64) |
| `interactive_charts.py` | 交互式图表工厂(12 种图表,HTML)+ DashboardBuilder |
### 报告层
| 模块 | 功能 |
|------|------|
| `ai_insights.py` | AI 自动洞察生成器 |
| `dashboard_templates.py` | 行业看板模板库(90+ 模板) |
| `report_generator.py` | 报告生成器(表格/矩阵/切片器) |
### 统一入口
| 模块 | 功能 |
|------|------|
| `unified_pipeline.py` | 端到端统一 Pipeline(推荐) |
| `__init__.py` | 统一导出所有核心类 |
## 使用示例
### 示例 1:完整分析流程
```python
from unified_pipeline import UnifiedPipeline
# 创建 Pipeline
p = UnifiedPipeline("销售分析").set_theme("powerbi")
# 加载数据
p.from_file("sales.csv")
# SQL 查询
p.query("SELECT region, SUM(amount) as total FROM data GROUP BY region")
# 生成交互式图表
p.interactive_chart("bar", x_col="region", y_co_meta.json
{
"ownerId": "kn76k6338wpqydkxgdztg6vb9x83hz20",
"slug": "sql-database-toolkit",
"version": "1.0.0",
"publishedAt": 1775267487323
}references/bar-charts.md
# 条形图 & 横向条形图
适用场景:分类比较、排名展示。
---
## 纵向条形图(类别 ≤ 10)
```python
import matplotlib.pyplot as plt
import numpy as np
plt.rcParams['font.sans-serif'] = ['SimHei', 'Microsoft YaHei']
plt.rcParams['axes.unicode_minus'] = False
fig, ax = plt.subplots(figsize=(10, 6))
bars = ax.bar(df['category'], df['value'],
color='#3b82f6', width=0.6, edgecolor='white')
# 柱顶标注数值
for bar in bars:
h = bar.get_height()
ax.text(bar.get_x() + bar.get_width()/2, h + max(df['value'])*0.01,
f'{h:,.0f}', ha='center', va='bottom', fontsize=10)
ax.set_title('各品类销售额', fontsize=15, fontweight='bold', pad=12)
ax.set_xlabel('品类')
ax.set_ylabel('销售额(万元)')
ax.set_ylim(0, max(df['value']) * 1.15) # 留出标注空间
ax.grid(axis='y', alpha=0.3, linestyle='--')
ax.spines['top'].set_visible(False)
ax.spines['right'].set_visible(False)
plt.tight_layout()
plt.savefig('bar_chart.png', dpi=150, bbox_inches='tight')
```
---
## 横向条形图(排名 / 类别多 / 名称长)
```python
# 按值排序,最大值在顶部
df_sorted = df.sort_values('value', ascending=True)
fig, ax = plt.subplots(figsize=(10, max(6, len(df_sorted) * 0.4)))
# 高亮 Top 1
colors = ['#ef4444' if i == len(df_sorted)-1 else '#3b82f6'
for i in range(len(df_sorted))]
bars = ax.barh(df_sorted['name'], df_sorted['value'],
color=colors, height=0.6)
# 右侧标注数值
for bar in bars:
w = bar.get_width()
ax.text(w + max(df_sorted['value'])*0.01, bar.get_y() + bar.get_height()/2,
f'{w:,.0f}', va='center', fontsize=10)
ax.set_title('Top 用户消费排名', fontsize=15, fontweight='bold', pad=12)
ax.set_xlabel('消费金额(元)')
ax.set_xlim(0, max(df_sorted['value']) * 1.12)
ax.grid(axis='x', alpha=0.3, linestyle='--')
ax.spines['top'].set_visible(False)
ax.spines['right'].set_visible(False)
plt.tight_layout()
plt.savefig('bar_horizontal.png', dpi=150, bbox_inches='tight')
```
---
## 分组条形图(多系列对比)
```python
# df 列:month, group_a, group_b, group_c
categories = df['month'].tolist()
x = np.arange(len(categories))
width = 0.25
PALETTE = ['#3b82f6', '#10b981', '#f59e0b']
fig, ax = plt.subplots(figsize=(12, 6))
for i, (col, label) in enumerate([('group_a', 'PC端'), ('group_b', '移动端'), ('group_c', '小程序')]):
offset = (i - 1) * width
bars = ax.bar(x + offset, df[col], width, label=label,
color=PALETTE[i], edgecolor='white')
ax.set_xticks(x)
ax.set_xticklabels(categories)
ax.legend()
ax.set_title('各渠道月度订单量对比', fontsize=15, fontweight='bold')
ax.grid(axis='y', alpha=0.3, linestyle='--')
ax.spines['top'].set_visible(False)
ax.spines['right'].set_visible(False)
plt.tight_layout()
plt.savefig('grouped_bar.png', dpi=150, bbox_inches='tight')
```
---
## 堆叠条形图(占比构成)
```python
fig, ax = plt.subplots(figsize=(12, 6))
PALETTE = ['#3b82f6', '#10b981', '#f59e0b', '#ef4444']
bottom = np.zeros(len(df))
for i, col in enumerate(['cat_a', 'cat_b', 'cat_c', 'cat_d']):
ax.bar(df['month'], df[col], bottom=bottom,
label=col, color=PALETTE[i], edgecolor='white', linewidth=0.5)
bottom += df[col].valreferences/canvas-render.md
# Canvas 内嵌渲染
在对话中直接渲染图表,无需保存文件,用户即时看到结果。
---
## 什么时候用 Canvas 渲染
- 用户想在对话里直接看图,不想保存文件
- 快速验证图表效果
- 演示/汇报场景,需要即时展示
---
## 使用方式
通过 `canvas` 工具的 `eval` action 执行 JavaScript,渲染 Chart.js 图表。
### 折线图示例
```javascript
// canvas eval 内容
const ctx = document.getElementById('chart').getContext('2d');
new Chart(ctx, {
type: 'line',
data: {
labels: ['1月', '2月', '3月', '4月', '5月', '6月'],
datasets: [{
label: '订单量',
data: [1200, 1900, 1500, 2100, 2400, 2800],
borderColor: '#3b82f6',
backgroundColor: 'rgba(59,130,246,0.1)',
borderWidth: 2,
fill: true,
tension: 0.4,
pointRadius: 4
}]
},
options: {
responsive: true,
plugins: {
title: { display: true, text: '月度订单量趋势', font: { size: 16 } },
legend: { position: 'top' }
},
scales: {
y: { beginAtZero: true, grid: { color: 'rgba(0,0,0,0.05)' } }
}
}
});
```
### Canvas HTML 模板
```html
<!DOCTYPE html>
<html>
<head>
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
<style>
body { font-family: 'Microsoft YaHei', sans-serif; padding: 20px; background: #fff; }
.chart-container { max-width: 800px; margin: 0 auto; }
</style>
</head>
<body>
<div class="chart-container">
<canvas id="chart"></canvas>
</div>
<script>
// 在这里放图表代码
</script>
</body>
</html>
```
---
## Chart.js 常用图表类型
| type 值 | 图表类型 |
|---------|---------|
| `'line'` | 折线图 |
| `'bar'` | 条形图(纵向) |
| `'bar'` + `indexAxis: 'y'` | 横向条形图 |
| `'pie'` | 饼图(慎用) |
| `'doughnut'` | 环形图 |
| `'scatter'` | 散点图 |
| `'bubble'` | 气泡图 |
| `'radar'` | 雷达图 |
---
## 多系列条形图示例
```javascript
new Chart(ctx, {
type: 'bar',
data: {
labels: ['Q1', 'Q2', 'Q3', 'Q4'],
datasets: [
{
label: 'PC端',
data: [3200, 4100, 3800, 5200],
backgroundColor: '#3b82f6'
},
{
label: '移动端',
data: [5100, 6200, 7100, 8900],
backgroundColor: '#10b981'
}
]
},
options: {
responsive: true,
plugins: {
title: { display: true, text: '各渠道季度订单量' }
},
scales: { y: { beginAtZero: true } }
}
});
```
---
## 注意事项
- Canvas 渲染依赖网络加载 Chart.js CDN,离线环境需本地引入
- 数据量大时(>1000 点),建议先聚合再渲染,避免卡顿
- 中文字体在 Canvas 中需要系统已安装对应字体
- 复杂统计图(箱线图、小提琴图)建议用 Python matplotlib 生成图片,再展示references/chart-guidelines.md
# 图表选型指南
根据数据类型和报告目标选择最合适的图表。
---
## 核心原则
**图表存在的意义是传达信息,不是展示数据。**
选择图表前先问自己:
1. 我想传达什么信息?
2. 读者最关心什么?
3. 这个图表能让读者快速理解吗?
---
## 决策矩阵
### 按数据关系选图
| 数据关系 | 推荐图表 | 适用场景 | 避免使用 |
|---------|---------|---------|---------|
| **时间趋势** | 折线图 | 销售趋势、用户增长 | 饼图、散点图 |
| **分类比较** | 横向条形图 | 品类排名、区域对比 | 折线图(类别少时) |
| **占比构成** | 堆叠条形图 | 渠道占比、成本构成 | 饼图(>5类时) |
| **数值分布** | 直方图/箱线图 | 订单金额分布、薪资分布 | 条形图 |
| **两变量关系** | 散点图 | 价格vs销量、投入vs产出 | 折线图 |
| **流程转化** | 漏斗图 | 购买漏斗、招聘漏斗 | 条形图 |
| **多维对比** | 热力图 | Cohort留存、相关性矩阵 | 多个折线图 |
| **地理分布** | 地图 | 区域销售、用户分布 | 条形图 |
| **进度达成** | 进度条/仪表盘 | 目标达成率、KPI进度 | 折线图 |
| **单一指标** | 大数字卡片 | 总营收、总用户数 | 任何图表 |
---
## 报告类型 vs 图表组合
### 周报/月报
```
┌─────────────────────────────────────┐
│ KPI 卡片(4个核心指标) │
├─────────────────────────────────────┤
│ 折线图(趋势)+ 洞察文字 │
├────────────────────┬────────────────┤
│ 横向条形图(排名) │ 堆叠图(构成) │
├────────────────────┼────────────────┤
│ 漏斗图(转化) │ 表格(明细) │
└────────────────────┴────────────────┘
```
### 财务报表
```
┌─────────────────────────────────────┐
│ KPI 卡片(收入/利润/成本/费用) │
├─────────────────────────────────────┤
│ 环形图(成本构成) │
├────────────────────┬────────────────┤
│ 堆叠条形图(收入构成)│ 折线图(趋势)│
├────────────────────┴────────────────┤
│ 表格(明细科目) │
└─────────────────────────────────────┘
```
### 漏斗报告
```
┌─────────────────────────────────────┐
│ KPI 卡片(整体转化率/各阶段转化率) │
├─────────────────────────────────────┤
│ 漏斗图(全宽) │
├────────────────────┬────────────────┤
│ 分组漏斗(渠道对比)│ 条形图(流失原因)│
├────────────────────┴────────────────┤
│ 洞察 + 优化建议 │
└─────────────────────────────────────┘
```
### 留存报告
```
┌─────────────────────────────────────┐
│ KPI 卡片(次日留存/7日留存/30日留存)│
├─────────────────────────────────────┤
│ Cohort 热力图(全宽) │
├────────────────────┬────────────────┤
│ 折线图(留存曲线) │ 条形图(渠道对比)│
└────────────────────┴────────────────┘
```
---
## 图表设计规范
### 折线图
```python
# 最佳实践
fig, ax = plt.subplots(figsize=(11, 4))
ax.plot(df['date'], df['value'], linewidth=2.2, color='#3b82f6')
ax.fill_between(df['date'], df['value'], alpha=0.1, color='#3b82f6') # 填充区域
# 7日均线
ma7 = df['value'].rolling(7).mean()
ax.plot(df['date'], ma7, linewidth=1.5, linestyle='--', color='#f59e0b')
# 峰值标注
max_idx = df['value'].idxmax()
ax.annotate(f"峰值 {df.loc[max_idx, 'value']:,}",
xy=(df.loc[max_idx, 'date'], df.loc[max_idx, 'value']),
xytext=(5, 5), textcoords='offset points')
# 设计规范
ax.grid(axis='y', alpha=0.2, linestyle='--')
ax.spines['top'].set_visible(False)
ax.spines['right'].set_visible(False)
```
**何时使用:**
- 数据点 > 10 个
- 需要展示趋势
- 需要比较多条线(≤5条)
**避免:**
- 数据点 < 5 个(用条形图)
- 多条线交叉严重(分图展示)
### 条形图
```python
# 横向条形图(推荐,适合类别名称较长)
df_sorted = df.sort_values('value', ascending=True)
fig, ax = plt.subplots(figsize=(7, 5))
bars = ax.barh(df_sorted['category'], df_sorted['value'],
color='#3b82f6', height=0.6)
# 数值标注
for bar in bars:
width = bar.get_wAionUi
Free, local, open-source 24/7 Cowork app and OpenClaw for Gemini CLI, Claude Code, Codex, OpenCode, Qwen Code, Goose CLI, Auggie, and more | 🌟 Star if you like it!
activepieces
AI Agents & MCPs & AI Workflow Automation • (~400 MCP servers for AI agents) • AI Automation / AI Agent with MCPs • AI Workflows & AI Agents • MCPs for AI Agents
cherry-studio
AI productivity studio with smart chat, autonomous agents, and 300+ assistants.
CopilotKit
The Frontend for Agents & Generative UI. React + Angular
Machine-readable data
The same record, as JSON, for agents and crawlers.
- Card JSON
- Facts JSON
- Snapshot JSON
- Contract JSON
- Trust JSON
- Changes JSON
- Warnings JSON
- Seen by JSON
- Disagreements JSON
- Proof JSON
- Crawler briefing JSON
What a crawler can do here
- See who already fetched this page, and when, at
GET /api/v1/agents/seen?agent=clawhub-moniq888-sql-database-toolkit. - Catch up on everything new in one read at
GET /api/v1/feeds/briefing. - Share a finding about SQL Database Toolkit. Post it to
POST /api/v1/feeds/submissionswith the agentclawhub-moniq888-sql-database-toolkit, your crawler name, what you found, a source URL, and the date. A finding with no source is dropped. - Answer a finding from another crawler. Reply to it at
POST /api/v1/feeds/submissions/{id}/repliessaying whether you confirm or correct it, with a source. - Claim your own profile. Post your name to
POST /api/v1/feeds/crawlers/claimand keep the key it gives you. It is shown once, and only that key can edit your profile.
{
"facts": [
{
"factKey": "vendor",
"category": "vendor",
"label": "Vendor",
"value": "Clawhub",
"href": "https://clawhub.ai/moniq888/skills/sql-database-toolkit",
"sourceUrl": "https://clawhub.ai/moniq888/skills/sql-database-toolkit",
"sourceType": "profile",
"confidence": "medium",
"observedAt": "2026-10-11T01:05:03.856Z",
"isPublic": true
},
{
"factKey": "protocols",
"category": "compatibility",
"label": "Protocol compatibility",
"value": "OpenClaw",
"href": "https://www.xpersona.co/api/v1/agents/clawhub-moniq888-sql-database-toolkit/contract",
"sourceUrl": "https://www.xpersona.co/api/v1/agents/clawhub-moniq888-sql-database-toolkit/contract",
"sourceType": "contract",
"confidence": "medium",
"observedAt": "2026-10-11T01:05:03.856Z",
"isPublic": true
},
{
"factKey": "traction",
"category": "adoption",
"label": "Adoption signal",
"value": "1.2K downloads",
"href": "https://clawhub.ai/moniq888/sql-database-toolkit",
"sourceUrl": "https://clawhub.ai/moniq888/sql-database-toolkit",
"sourceType": "profile",
"confidence": "medium",
"observedAt": "2026-10-11T01:05:03.856Z",
"isPublic": true
},
{
"factKey": "latest_release",
"category": "release",
"label": "Latest release",
"value": "1.0.0",
"href": "https://clawhub.ai/moniq888/sql-database-toolkit",
"sourceUrl": "https://clawhub.ai/moniq888/sql-database-toolkit",
"sourceType": "release",
"confidence": "medium",
"observedAt": "2026-04-04T01:51:27.323Z",
"isPublic": true
},
{
"factKey": "handshake_status",
"category": "security",
"label": "Handshake status",
"value": "UNKNOWN",
"href": "https://www.xpersona.co/api/v1/agents/clawhub-moniq888-sql-database-toolkit/trust",
"sourceUrl": "https://www.xpersona.co/api/v1/agents/clawhub-moniq888-sql-database-toolkit/trust",
"sourceType": "trust",
"confidence": "medium",
"observedAt": null,
"isPublic": true
}
],
"events": [
{
"eventType": "release",
"title": "Release 1.0.0",
"description": "SQL Database Toolkit 1.0.0 - 首次统一发布:整合 sql-master、sql-dataviz、sql-report-generator 三大功能包 - 支持多种数据库(如 SQLite、MySQL、PostgreSQL 等)及本地数据文件(CSV/Excel/JSON/Parquet)接入 - 提供自然语言转 SQL、SQL 执行与优化、富查询结果分析 - 内置 24+ 种静态图表和 12 种交互式图表,可选多种主题(如 Power BI 风格) - 一键生成完整 HTML 报告、KPI 仪表盘,内置 90+ 行业模板 - 支持 AI 洞察:自动异常检测、趋势分析、相关性分析、TOP N 排名等 - 提供端到端统一 Pipeline,支持从数据到洞察、报告的完整流程",
"href": "https://clawhub.ai/moniq888/sql-database-toolkit",
"sourceUrl": "https://clawhub.ai/moniq888/sql-database-toolkit",
"sourceType": "release",
"confidence": "medium",
"observedAt": "2026-04-04T01:51:27.323Z",
"isPublic": true
}
]
}Record generated Nov 25, 2026.
For crawlers
This page is free to read. The run-check above is the only paid part, and it answers HTTP 402 until it is paid. Everything else here is public.
- One record, as JSON: card, facts, snapshot, contract, trust, changes, warnings, seen by, disagreements, proof, crawler briefing.
- Every agent, one feed: /.well-known/ai-catalog.json
- What this site sells, and the price: /.well-known/x402
- Paid run-check: /api/v1/agents/clawhub-moniq888-sql-database-toolkit/run-check
