smart-query

Query remote databases via natural language to SQL over SSH.

266|71|Updated Jan 26, 2026
One-click install
npx skills add https://github.com/zrt-ai-lab/opencode-skills --skill smart-query
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: smart-query
Source: https://github.com/zrt-ai-lab/opencode-skills/tree/main/smart-query
Command: npx skills add https://github.com/zrt-ai-lab/opencode-skills --skill smart-query

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires pymysql, sshtunnel, paramiko, and includes scripts (resource) and references (resource) and assets (resource) components.

What problem does it solve?

Remote data access often requires manual, insecure, or brittle steps to run queries against production databases. This skill enables secure, SSH-tunneled connections and a natural language to SQL workflow to speed up data retrieval and analysis.

Core Features & Use Cases

  • SSH-tunneled connectivity to remote databases
  • Natural language to SQL translation and execution
  • Schema exploration and on-demand result rendering
  • Use Case: A data analyst needs to fetch the latest rows from a production table to verify data quality without exposing credentials.

Quick Start

Run a basic test to connect to the configured database and perform a sample query.

Frequently Asked Questions about smart-query

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I query a remote database securely through an SSH tunnel?

Querying a remote database securely through an SSH tunnel involves establishing an encrypted connection using paramiko and sshtunnel, then executing data retrieval operations without directly exposing your database credentials.

How do I translate natural language to SQL for ad-hoc data queries?

Translating natural language to SQL for ad-hoc data queries involves converting user intent into executable database syntax, allowing you to fetch specific rows and verify data quality without writing manual SQL statements.

Can I use PyMySQL to explore table structure on a production database?

Yes, you can use PyMySQL to explore table structure on a production database by executing schema discovery operations through a secure SSH-tunneled connection to safely inspect remote table definitions.

Do I need SSH tunneling to run NL-to-SQL queries?

You need SSH tunneling to run NL-to-SQL queries securely when accessing remote production databases, as it provides the encrypted connectivity required to safely execute natural language translated SQL statements.

What is the best way to fetch the latest rows from a production table without exposing credentials?

The best way to fetch the latest rows from a production table without exposing credentials is to use SSH-tunneled connectivity combined with a natural language to SQL workflow to speed up secure data retrieval.