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.