跳到正文
TakoAPI
返回技能列表

db-readonly

由 reed1898 提供

Browser & Automation
835下载量由 clawskills.sh 提供
0浏览量
0 个赞登录后即可为这个技能点赞
—暂无评分
你的评分

简介

Run safe read-only queries against MySQL or PostgreSQL for data inspection, reporting, and troubleshooting.

描述

该技能的功能

Runs read-only queries against PostgreSQL or MySQL databases. Supports SELECT, WITH, and EXPLAIN statements, and can export results to CSV, TSV, or JSON. Blocks INSERT, UPDATE, DELETE, DROP, and ALTER to prevent accidental data modification.

Enforces read-only access at the skill level, so exploratory database work can't accidentally modify or delete data.

何时使用

  • Inspecting table schemas before writing a migration
  • Counting rows to verify a data import completed
  • Sampling user records to debug a reported issue
  • Exporting query results to CSV for a stakeholder report
  • Running EXPLAIN on a slow query to diagnose performance

示例工作流

输入

User asks: Show me the 10 most recent orders with their totals

智能体
  1. 1

    Reads PGHOST, PGDATABASE, PGUSER, PGPASSWORD from environment

  2. 2

    Constructs a SELECT query with ORDER BY created_at DESC and LIMIT 10

  3. 3

    Runs scripts/db_readonly.sh postgres with the query

  4. 4

    Returns the result rows to the user

输出

A table of 10 order rows showing id, created_at, and total columns

前置要求

  • PostgreSQL connection environment variables: PGHOST, PGDATABASE, PGUSER, PGPASSWORD
  • MySQL connection environment variables: MYSQL_HOST, MYSQL_DATABASE, MYSQL_USER, MYSQL_PASSWORD

安装

clawhub install reed1898/db-readonly

运行 CLI 命令,或把这段提示词粘贴到 Claude Code、Cursor、Codex 或你在用的任意编程智能体里。

链接