sql-runner

Community

Execute SQL on Dataphin and save timestamped CSV results.

AuthorOliverOuyang
Version1.0.0
Installs0

System Documentation

What problem does it solve?

Automates running SQL files against Dataphin, removing manual submission, polling, and result-saving steps so analysts can get query outputs as ready-to-open CSVs without handling MCP calls or file management.

Core Features & Use Cases

  • File-driven execution: Reads a local SQL file, extracts a query name from header comments or falls back to the filename.
  • MCP integration & polling: Submits queries via the sh_dp_mcp protocol, polls status at regular intervals, enforces a 5-minute timeout and can kill timed-out tasks.
  • Result management: Saves results as UTF-8 with BOM CSV files in a data/ subfolder with sanitized, timestamped filenames and reports row counts.
  • Robust error handling: Detects permission issues, syntax errors, connection failures, and empty results and provides actionable messages.
  • Use case examples: Ad-hoc analytics, scheduled data extraction, exporting query results for downstream reporting or analysis.

Quick Start

Run the SQL file at /path/to/query.sql and save the results as a timestamped CSV in the data/ subfolder.

Dependency Matrix

Required Modules

None required

Components

scripts

💻 Claude Code Installation

Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.

Please help me install this Skill:
Name: sql-runner
Download link: https://github.com/OliverOuyang/shuhe-work-skills/archive/main.zip#sql-runner

Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
View Source Repository

Agent Skills Search Helper

Install a tiny helper to your Agent, search and equip skill from 471,000+ vetted skills library on demand.