DB Read-Only Skill for Openclaw

A secure interface for executing read-only SQL queries against PostgreSQL and MySQL databases without risk of data modification.

reed1898
v1.0.0
Feb 10, 2026
0
2.8k
0

Install & Download

1. ClawHub CLI

The fastest way to install a skill directly from the registry.

npx clawhub@latest install db-readonly

2. Manual Installation

Copy the skill folder to one of these locations

Global
~/.openclaw/skills/
Workspace
<project>/skills/

Priority: Workspace > Local > Bundled

3. Prompt Installation

Copy this prompt to OpenClaw to install it automatically.

Help me install db-readonly using Clawhub. If Clawhub is not installed, install it first (npm i -g clawhub).

Prefer to download?

Get the raw skill files in a ZIP archive.

What is DB Read-Only Skill?

The DB Read-Only skill is a specialized utility designed for developers and AI agents who need to interact with live databases safely. By utilizing Openclaw Skills, this tool allows for seamless data inspection, schema verification, and row counting while enforcing a strict read-only policy. It serves as a protective layer that blocks any destructive SQL commands, ensuring that production data remains intact during troubleshooting or reporting tasks.

This skill bridges the gap between raw data access and operational security. It provides a standardized way to query databases like PostgreSQL and MySQL through environment variables, making it an essential addition to any developer's toolkit within the Openclaw Skills ecosystem.

DB Read-Only Skill Use Cases

  • Investigating production database issues by inspecting specific table records.
  • Generating data reports and exporting results to CSV, TSV, or JSON formats.
  • Sampling datasets to understand data distributions before writing migration scripts.
  • Verifying database schema structures and indexes without risking accidental changes.
  • Automating routine data checks and monitoring tasks through an AI agent.

How DB Read-Only Skill Works

  1. The user provides a SQL query and specifies the database type (PostgreSQL or MySQL).
  2. The skill retrieves the necessary connection credentials from predefined environment variables.
  3. A safety engine validates the SQL statement to ensure it only contains SELECT, WITH, or EXPLAIN keywords.
  4. The command is executed via a specialized shell script that interfaces with the database engine.
  5. Query results are returned to the console or saved to a specified output file in the requested format.

DB Read-Only Skill Setup

To get started with this skill from the Openclaw Skills library, configure your environment variables and use the provided scripts:

# PostgreSQL Configuration
export PGHOST='localhost'
export PGDATABASE='mydb'
export PGUSER='admin'
export PGPASSWORD='password'

# MySQL Configuration
export MYSQL_HOST='localhost'
export MYSQL_DATABASE='mydb'
export MYSQL_USER='admin'
export MYSQL_PASSWORD='password'

# Execute a test query
./scripts/db_readonly.sh postgres "SELECT now();"

DB Read-Only Skill Data Schema & Taxonomy

The skill manages data through environment variables and local file exports as follows:

Type Details
Connection Vars PGHOST, PGPORT, PGDATABASE, MYSQL_HOST, etc.
Export Formats CSV, TSV, JSON
Query Types SELECT, WITH, EXPLAIN
Safety Logic Blocks INSERT, UPDATE, DELETE, DROP, ALTER

DB Read-Only Skill Advanced Features

  • Multi-database support handling both PostgreSQL and MySQL connections simultaneously.
  • Flexible output formatting for seamless integration with data analysis pipelines.
  • Automated safety enforcement that prevents execution of risky or destructive SQL.
  • Detailed execution plan analysis using EXPLAIN to optimize performance within Openclaw Skills.
  • Query results can be directed to local temporary files for large-scale data processing.

SKILL.md


Loading

Related Openclaw Skills

METADATA

Github Stars: 0
forks: 0

Featured*