run-sql
SKILL.md
Execute SQL on the local development database. Auto-detects connection method from project context.
SQL Runner
- DB Engine: auto-detect (see Step 1)
- Schema File:
.claude/natural-sql/schema.tsv(if exists)
Claim Conditions
I claim the query when:
- User explicitly mentions "local", "localhost", "docker", "my db", "dev db"
- User does NOT mention a remote environment (production, staging, etc.)
- No other runner has claimed the query (I am the default fallback)
- User mentions project-specific tables without specifying a remote environment — this means local
Key rule: If the user says "traeme los usuarios en telespine user" without mentioning prod/stg/dev, I claim it and run it against the local DB. I infer the connection from the project context (Docker, Django settings, etc.).
Step 1 — Determine Connection Method
Priority order:
.claude/natural-sql/config.mdexists with## Query Command→ use it as-is- Auto-detect from project:
docker-compose.yml/compose.yml:mysql/mariadbimage →docker compose exec <service> mysql -u <user> -p<pass> <dbname> --table -e "{sql}"postgresimage →docker compose exec <service> psql -U <user> -d <dbname> -c "{sql}"
- Django
DATABASESsetting → build CLI command from ENGINE/HOST/NAME/USER/PASSWORD - Rails
config/database.yml→ extract dev config db.sqlite3exists →sqlite3 db.sqlite3 "{sql}"
- Can't detect → ask user, suggest saving to
.claude/natural-sql/config.md
Step 2 — Execute
Run the determined command with the SQL.
Step 3 — Display Results
Format and show the output to the user.
Safety Rules
- READ-ONLY by default. Warn on write operations (
INSERT,UPDATE,DELETE,DROP,ALTER,TRUNCATE,CREATE). - Never run
DROP DATABASEorTRUNCATE. - Escape quotes properly for shell transit.
Weekly Installs
1
Repository
wilmanbarrios/skillsFirst Seen
4 days ago
Security Audits
Installed on
mcpjam1
claude-code1
replit1
junie1
windsurf1
zencoder1