ClawKit Logo
ClawKitReliability Toolkit
Back to Registry
Official Verified developer tools Safety 5/5

db-readonly

Run safe read-only queries against MySQL or PostgreSQL for data inspection, reporting, and troubleshooting. Use when the user asks to read tables, inspect schema, count rows, sample data, or export query results without modifying data.

Why use this skill?

Safely inspect, analyze, and export data from PostgreSQL and MySQL databases using OpenClaw db-readonly. Protect your production data with strict read-only query enforcement.

skill-install — Terminal

Install via CLI (Recommended)

clawhub install openclaw/skills/skills/ryanhong666/db-readonly
Or

What This Skill Does

The db-readonly skill provides a secure, restricted interface for interacting with your production or staging databases. It is designed specifically for PostgreSQL and MySQL instances, enabling AI agents to perform data inspection, diagnostic queries, and report generation without the risk of accidental data loss or corruption. The skill enforces a strict read-only policy, automatically blocking any destructive SQL commands like DELETE, DROP, or UPDATE. By leveraging environment variables for configuration, it integrates seamlessly into existing infrastructure, allowing the AI to query schemas, count row volumes, and export datasets to various formats like CSV or JSON for further analysis.

Installation

To integrate this skill into your OpenClaw environment, execute the following command in your terminal: clawhub install openclaw/skills/skills/ryanhong666/db-readonly

Once installed, ensure your database credentials are correctly defined in your environment configuration, specifically using standard variables like PGHOST, PGDATABASE, or MYSQL_HOST and their associated authentication keys.

Use Cases

This skill is indispensable for technical teams, data analysts, and DevOps engineers who need rapid answers from their database layer. Use this skill when you need to:

  • Validate that a recent migration correctly populated a specific table.
  • Troubleshoot application issues by inspecting recent records for error timestamps or status codes.
  • Generate ad-hoc reports or summaries for non-technical stakeholders.
  • Audit data quality by checking for null values or inconsistent formatting in critical user tables.
  • Export snapshots of data into temporary files for visualization tools or local data science experiments.

Example Prompts

  1. "Check the database to see how many users signed up in the last 24 hours."
  2. "Inspect the schema of the orders table and provide a list of all column names and their data types."
  3. "Run a query on the MySQL production instance to sample 50 records from the transaction log and save the result to /tmp/transactions_sample.csv."

Tips & Limitations

To maximize the utility and security of this skill, always include a LIMIT clause in your prompts to prevent memory-intensive scans on large datasets. While the skill is hardened against malicious SQL, it is recommended to use a database user account with the minimum necessary read privileges to follow the principle of least privilege. Remember that this skill cannot modify the database state; if you require schema migrations or data adjustments, perform those manually through authorized administrative tools. For advanced queries, refer to the references/query-cookbook.md provided in the repository.

Metadata

Stars1133
Views8
Updated2026-02-18
View Author Profile
AI Skill Finder

Not sure this is the right skill?

Describe what you want to build — we'll match you to the best skill from 16,000+ options.

Find the right skill
Add to Configuration

Paste this into your clawhub.json to enable this plugin.

{
  "plugins": {
    "official-ryanhong666-db-readonly": {
      "enabled": true,
      "auto_update": true
    }
  }
}

Tags(AI)

#database#sql#postgresql#mysql#data-inspection
Safety Score: 5/5

Flags: file-write, file-read, code-execution