LaunchKit · 2026
Back to Skills

db-readonly

Run safe read-only queries against MySQL or PostgreSQL for data inspection, reporting, and troubleshooting.

0
835 downloads
by @reed1898

Setup & Installation

openclaw skills install @reed1898/db-readonly

Or with the ClawHub CLI, for registry-managed skill folders outside a full OpenClaw workspace:

npx clawhub install db-readonly

What This Skill Does

Runs read-only queries against PostgreSQL or MySQL databases. Supports SELECT, WITH, and EXPLAIN statements, and can export results to CSV, TSV, or JSON. Blocks INSERT, UPDATE, DELETE, DROP, and ALTER to prevent accidental data modification.

Enforces read-only access at the skill level, so exploratory database work can't accidentally modify or delete data.

When to use it

  • Inspecting table schemas before writing a migration
  • Counting rows to verify a data import completed
  • Sampling user records to debug a reported issue
  • Exporting query results to CSV for a stakeholder report
  • Running EXPLAIN on a slow query to diagnose performance

Example Workflow

Here's how your AI assistant might use this skill in practice.

INPUT

User asks: Show me the 10 most recent orders with their totals

AGENT
  1. 1Reads PGHOST, PGDATABASE, PGUSER, PGPASSWORD from environment
  2. 2Constructs a SELECT query with ORDER BY created_at DESC and LIMIT 10
  3. 3Runs scripts/db_readonly.sh postgres with the query
  4. 4Returns the result rows to the user
OUTPUT

A table of 10 order rows showing id, created_at, and total columns

Requirements

Accounts, API keys, or tools you or your AI assistant may need to set up while using this skill.

PostgreSQL connection environment variables: PGHOST, PGDATABASE, PGUSER, PGPASSWORDMySQL connection environment variables: MYSQL_HOST, MYSQL_DATABASE, MYSQL_USER, MYSQL_PASSWORD