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.
Install via CLI (Recommended)
clawhub install openclaw/skills/skills/ryanhong666/db-readonlyWhat 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
- "Check the database to see how many users signed up in the last 24 hours."
- "Inspect the schema of the orders table and provide a list of all column names and their data types."
- "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
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 skillPaste this into your clawhub.json to enable this plugin.
{
"plugins": {
"official-ryanhong666-db-readonly": {
"enabled": true,
"auto_update": true
}
}
}Tags(AI)
Flags: file-write, file-read, code-execution
Related Skills
Reminder
Skill by ryanhong666
knowledge-base-collector
Collect and organize a personal knowledge base from URLs (web/X/WeChat) and screenshots. Use when the user says they want to save an URL, ingest a link, archive content to KB, tag/classify notes, store screenshots, or search their saved knowledge in Telegram. Supports WeChat via a connected macOS node when cloud fetch is blocked.
larksuite-wiki
Manage and export Lark Suite (Feishu) Wiki/Knowledge Base documents. Read, search, sync with subdocuments, and incremental export to local Markdown files.
claw-roam
Sync OpenClaw workspace between multiple machines (local Mac and remote VPS) via Git. Enables seamless migration of OpenClaw personality, memory, and skills. Use when user wants to (1) push workspace changes to remote before shutdown, (2) pull latest workspace on a new machine, (3) check sync status between machines, (4) migrate OpenClaw to another machine.