LaunchKit · 2026
Back to Skills

db-readonly

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

0
0 downloads
by @ryanhong666

Setup & Installation

openclaw skills install @ryanhong666/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 using connection environment variables. Supports SELECT, WITH, and EXPLAIN statements, and can export results to CSV, TSV, or JSON. Blocks any SQL that would modify data.

Enforcing read-only at the skill level prevents accidental data modification when exploring live databases.

When to use it

  • Counting rows in a production table without risking writes
  • Exporting a user segment to CSV for analysis
  • Inspecting table schema before writing a migration
  • Sampling recent records to debug an application issue
  • Running EXPLAIN on a slow query to check the execution plan

Example Workflow

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

INPUT

User asks: export all orders from the last 7 days to a CSV file

AGENT
  1. 1Identify the target database type (PostgreSQL or MySQL) from context
  2. 2Construct a SELECT query with a date filter and appropriate LIMIT
  3. 3Run scripts/db_readonly.sh with --format csv and --out flags
  4. 4Confirm the output file path and row count to the user
OUTPUT

A CSV file at the specified path containing matching order rows

Requirements

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

PGHOST, PGDATABASE, PGUSER, PGPASSWORD environment variables (PostgreSQL)MYSQL_HOST, MYSQL_DATABASE, MYSQL_USER, MYSQL_PASSWORD environment variables (MySQL)