Data Query & Visualization Skill for Openclaw

A powerful NL2SQL engine that generates secure SQL queries and interactive HTML dashboards using ECharts for multiple database dialects.

ylyuanlu
v1.0.0
Apr 9, 2026
0
1k
0

Install & Download

1. ClawHub CLI

The fastest way to install a skill directly from the registry.

npx clawhub@latest install data-query

2. Manual Installation

Copy the skill folder to one of these locations

Global
~/.openclaw/skills/
Workspace
<project>/skills/

Priority: Workspace > Local > Bundled

3. Prompt Installation

Copy this prompt to OpenClaw to install it automatically.

Help me install data-query using Clawhub. If Clawhub is not installed, install it first (npm i -g clawhub).

Prefer to download?

Get the raw skill files in a ZIP archive.

What is Data Query & Visualization Skill?

The data-query skill is a specialized tool within the Openclaw Skills framework designed to bridge the gap between natural language questions and database insights. It provides advanced NL2SQL capabilities, enabling AI agents to translate complex user queries into accurate SQL statements for MySQL, Oracle, and Dameng (DM) databases.\n\nBeyond simple querying, this skill excels at creating production-ready visualization pages. It automatically generates ECharts-based HTML dashboards (Cockpits) that include KPI cards, scatter plots, timelines, and kanban boards. With built-in AES-256-CBC encryption for SQL queries embedded in the frontend, it ensures that your data exploration remains secure and compliant with enterprise standards.

Data Query & Visualization Skill Use Cases

  • Requesting project status updates like "List all overdue tasks for Project A" via natural language.\n- Generating comprehensive risk heatmaps and resource load distribution dashboards automatically.\n- Automating the creation of executive project cockpits with real-time KPI metrics and timelines.\n- Validating SQL query feasibility across different database dialects before execution.

How Data Query & Visualization Skill Works

  1. The agent receives a natural language prompt and identifies the target database schema using the built-in knowledge base.\n2. It generates a dialect-specific SQL query (MySQL, Oracle, or DM) based on predefined security and generation rules.\n3. The query is validated through a unified verification engine that checks execution via both direct DB connection and API endpoints.\n4. For visualization requests, the SQL is encrypted using AES-256-CBC and injected into an HTML template.\n5. The skill outputs a standalone, interactive HTML file containing ECharts visualizations and secure data-fetching logic.

Data Query & Visualization Skill Setup

Ensure you have the required database drivers installed (dmPython for DM, pyodbc for Oracle). Configure the credentials in the local config file.\n\nSet environment variables for your database type:\nbash\nexport DB_TYPE=dm\nexport DB_HOST=192.168.1.100\nexport DB_PORT=5236\nexport DB_NAME=ACM\nexport DB_USER=SYSDBA\nexport DB_PASSWORD=your_password\n\n\nInitialize the knowledge base by scanning your table structures for Openclaw Skills optimization:\nbash\ncd scripts/knowledge\npython3 generate.py --apply --target tables\n

Data Query & Visualization Skill Data Schema & Taxonomy

The skill manages a structured knowledge base to map business domains to database entities. This ensures high accuracy in Openclaw Skills deployments.\n\n| File | Path | Purpose |\n|---|---|---|\n| Field Mappings | knowledge/{dbType}/field_mapping.json | Maps database columns to Chinese names and enum values. |\n| Table Structures | knowledge/{dbType}/tables.json | Stores the physical schema metadata for SQL generation. |\n| KPI Formulas | knowledge/shared/kpi_formulas.json | Defines calculation logic for health scores and progress. |\n| Domain Evolution | knowledge/shared/evolved_domains.json | Persists learned mappings between user terms and tables. |

Data Query & Visualization Skill Advanced Features

  • Auto-Evolution: Dynamically learns new business domains and maps them to tables using the knowledge base scanner.\n- Multi-Dialect Support: Full support for MySQL, Oracle, and Dameng (DM) with automatic syntax handling for Openclaw Skills users.\n- Secure SQL Injection: Uses Encrypt-then-MAC (AES-256-CBC + HMAC-SHA256) to protect queries embedded in frontend HTML.\n- Unified Verification: Batch validates all dashboard queries via backend APIs before the final HTML is generated.\n- Customizable Cockpits: Support for tweak commands to adjust UI layouts, colors, and sidebar widths dynamically.

SKILL.md


Loading

Related Openclaw Skills

METADATA

Github Stars: 0
forks: 0

Featured*