← Back to Skills Marketplace
reed1898

DB Readonly

by Reed · GitHub ↗ · v1.0.0
cross-platform ⚠ suspicious
1402
Downloads
0
Stars
3
Active Installs
1
Versions
Install in OpenClaw
/install db-readonly
Description
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.
README (SKILL.md)

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

  • PGHOST
  • PGPORT (optional, default 5432)
  • PGDATABASE
  • PGUSER
  • PGPASSWORD

MySQL

  • MYSQL_HOST
  • MYSQL_PORT (optional, default 3306)
  • MYSQL_DATABASE
  • MYSQL_USER
  • MYSQL_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

  1. Refuse non-read SQL.
  2. Prefer LIMIT for exploratory queries.
  3. When user asks for updates/deletes/schema changes, ask explicit confirmation and do not run via this skill.
  4. Avoid printing secrets from env vars.

Reference

  • Query cookbook: references/query-cookbook.md
Usage Guidance
This skill appears to do what it claims (run read-only queries), but the package metadata failing to declare the required DB environment variables is a red flag — the skill will require your DB credentials even though that isn't advertised. Before installing or using it: (1) require the publisher to update metadata to list required env vars and clarify how secrets are handled; (2) only run against non-production or read-only accounts; create and use a DB user with minimal read-only privileges and limited schemas; (3) inspect and test the script in an isolated environment — note it exports PGPASSWORD/MYSQL_PWD which can be exposed by some system tools; prefer client-side auth methods (.pgpass, socket auth, or IAM-based short-lived creds) if available; (4) be cautious when using --out (files may contain sensitive data) and avoid running complex user-provided SQL without review; and (5) if you must proceed, run the script on a guarded workstation/network and validate output before sharing. If the author cannot justify the missing metadata or confirm safe handling of credentials, treat the skill as untrusted.
Capability Analysis
Type: OpenClaw Skill Name: db-readonly Version: 1.0.0 The skill is classified as suspicious primarily due to the arbitrary file write capability in `scripts/db_readonly.sh`. The `--out` parameter allows writing database query results to any specified file path. While intended for legitimate data export, this could be abused to overwrite critical system files (e.g., `/etc/hosts`, `/etc/resolv.conf`) with database output, potentially leading to denial of service or system disruption. Additionally, if sensitive data is queried, writing it to an insecure or publicly accessible location could lead to unintended data exposure. Although the `SKILL.md` and script include strong safeguards against non-read SQL, the file write capability introduces a significant risk without clear malicious intent.
Capability Assessment
Purpose & Capability
Name/description promise (read-only DB inspection for Postgres/MySQL) aligns with the script's behavior, but the skill metadata declares no required env vars/credentials while both SKILL.md and scripts rely on multiple DB credential env vars (PG*/MYSQL_*). That mismatch is a meaningful incoherence.
Instruction Scope
SKILL.md limits actions to read-only queries and points to the script; it documents the connection env vars and safety rules. The runtime instructions do not instruct the agent to access unrelated files or external endpoints. However, the guidance to "avoid printing secrets" is advisory only and not enforced.
Install Mechanism
No install spec (instruction-only + included script). Nothing is downloaded or written by an installer, which is low-risk from an install vector perspective.
Credentials
The skill needs DB credentials (PGHOST/PGDATABASE/PGUSER/PGPASSWORD or MYSQL_HOST/MYSQL_USER/MYSQL_PASSWORD, etc.) but the registry lists none. The script exports MYSQL_PWD and PGPASSWORD and expects those env vars to exist — using these env-based secrets is functional but can be risky (possible exposure in environment, saved outputs, or misconfiguration). Required credentials are not declared in metadata, which prevents automated checks and least-privilege enforcement.
Persistence & Privilege
always is false and the skill does not request persistent platform privileges or modify other skills/configs. Autonomous invocation is allowed (platform default) but not combined with other dangerous privileges here.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install db-readonly
  3. After installation, invoke the skill by name or use /db-readonly
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
v1.0.0
Initial release: safe read-only SQL runner for MySQL/Postgres.
Metadata
Slug db-readonly
Version 1.0.0
License
All-time Installs 3
Active Installs 3
Total Versions 1
Frequently Asked Questions

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.

💬 Comments