← 返回 Skills 市场
reed1898

DB Readonly

作者 Reed · GitHub ↗ · v1.0.0
cross-platform ⚠ suspicious
1402
总下载
0
收藏
3
当前安装
1
版本数
在 OpenClaw 中安装
/install 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.
使用说明 (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
安全使用建议
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.
功能分析
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.
能力评估
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.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install db-readonly
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /db-readonly 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
Initial release: safe read-only SQL runner for MySQL/Postgres.
元数据
Slug db-readonly
版本 1.0.0
许可证
累计安装 3
当前安装数 3
历史版本数 1
常见问题

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. 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 1402 次。

如何安装 DB Readonly?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install db-readonly」即可一键安装,无需额外配置。

DB Readonly 是免费的吗?

是的,DB Readonly 完全免费(开源免费),可自由下载、安装和使用。

DB Readonly 支持哪些平台?

DB Readonly 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 DB Readonly?

由 Reed(@reed1898)开发并维护,当前版本 v1.0.0。

💬 留言讨论