/install db-readonly
db-readonly
Use this skill for database read tasks only.
What this skill does
- Connect to PostgreSQL or MySQL using connection env vars
- Execute SELECT / WITH / EXPLAIN queries only
- Optionally save output to CSV/TSV/JSON
- Block risky SQL (
INSERT,UPDATE,DELETE,DROP,ALTER, etc.)
Connection env vars
PostgreSQL
PGHOSTPGPORT(optional, default 5432)PGDATABASEPGUSERPGPASSWORD
MySQL
MYSQL_HOSTMYSQL_PORT(optional, default 3306)MYSQL_DATABASEMYSQL_USERMYSQL_PASSWORD
Run
Use script:
scripts/db_readonly.sh postgres "SELECT now();"scripts/db_readonly.sh mysql "SELECT NOW();"
Export example:
scripts/db_readonly.sh postgres "SELECT * FROM users LIMIT 100" --format csv --out /tmp/users.csv
Safety rules
- Refuse non-read SQL.
- Prefer
LIMITfor exploratory queries. - When user asks for updates/deletes/schema changes, ask explicit confirmation and do not run via this skill.
- Avoid printing secrets from env vars.
Reference
- Query cookbook:
references/query-cookbook.md
- Make sure OpenClaw is installed (local or Docker)
- Run the install command in chat:
/install db-readonly - After installation, invoke the skill by name or use
/db-readonly - Provide required inputs per the skill's parameter spec and get structured output
What is 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. It is an AI Agent Skill for Claude Code / OpenClaw, with 1402 downloads so far.
How do I install DB Readonly?
Run "/install db-readonly" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.
Is DB Readonly free?
Yes, DB Readonly is completely free (open-source). You can download, install and use it at no cost.
Which platforms does DB Readonly support?
DB Readonly is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).
Who created DB Readonly?
It is built and maintained by Reed (@reed1898); the current version is v1.0.0.