DB Explorer for Openclaw

A database inspection and querying skill that connects to PostgreSQL, MySQL, SQLite, MongoDB, and Redis to check schemas, run queries, and export results.

lrg913427-dot
v2.3.0
May 27, 2026
0
635
0

Install & Download

1. ClawHub CLI

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

npx clawhub@latest install db-explorer-lens

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-explorer-lens 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 Explorer?

DB Explorer is an advanced command-line assistant designed to facilitate seamless database connections, queries, schema explorations, and automated exports directly from your terminal. By supporting a wide array of databases including PostgreSQL, MySQL, SQLite, MongoDB, and Redis, it serves as a central hub for database interactions during live development.

Using this capability within your Openclaw Skills workflow ensures both rapid diagnostics and rigorous query safety. DB Explorer is built with guardrails like read-only protections, query row limiting, and connection string safeguards, making it an indispensable asset for developers looking to safely debug, migrate, or analyze backend data systems.

DB Explorer Use Cases

  • Running raw SQL queries or NoSQL commands on PostgreSQL, MySQL, SQLite, MongoDB, and Redis safely.
  • Inspecting entire database schemas, column specifications, indices, and foreign key relationships.
  • Exporting tables and query results into standardized data formats like CSV and JSON.
  • Diagnosing database resource issues such as slow queries, oversized tables, and connection pool blockages.
  • Backing up or copying tables between distinct databases utilizing standardized dump methods.

How DB Explorer Works

  1. Identify Database and Credentials: The skill parses incoming environment variables or accepts direct user parameters to build a secure connection.
  2. Safe Verification: Runs a lightweight probe query to verify communication with the target DB without putting load on the system.
  3. Schema Mapping: Inspects system catalogs to generate a readable mapping of tables, collections, constraints, and relationships.
  4. Controlled Query Execution: Runs user-defined commands wrapped in transaction guards (BEGIN/ROLLBACK for writes) or automatically appends LIMIT clauses for read statements.
  5. Formatting and Exporting: Converts raw response payloads into clean markdown tables, CSV files, or compressed backup structures as requested.

DB Explorer Setup

Prerequisites

Install the appropriate CLI client for your database system of choice:

# PostgreSQL
brew install postgresql          # macOS
apt install postgresql-client    # Linux

# MySQL
brew install mysql               # macOS
apt install mysql-client         # Linux

# SQLite
apt install sqlite3              # Linux (built-in on macOS)

# MongoDB
brew install mongosh             # macOS

# Redis
brew install redis               # macOS
apt install redis-tools          # Linux

Environment Variables

Configure your connection parameters using environment variables:

# Option 1: Full Connection URL
export DATABASE_URL="postgresql://user:password@host:5432/dbname"

# Option 2: Parameter-based Configuration
export DB_TYPE="postgres"
export DB_HOST="localhost"
export DB_PORT="5432"
export DB_NAME="my_database"
export DB_USER="admin"
export DB_PASSWORD="secure_password"

DB Explorer Data Schema & Taxonomy

Data Formats and Configuration Schema

DB Explorer manages its configuration and handles exports using structured parameters.

Variable Type Description
DATABASE_URL String Connection URI taking priority. Supports SSL modes (e.g., ?sslmode=require).
DB_TYPE String Must be one of: postgres, mysql, sqlite, mongo, or redis.
DB_HOST String Database host address. Defaults to localhost.
DB_PORT Integer Connection port (e.g., 5432, 3306, 27017, 6379).
DB_NAME String Target database name or file path for SQLite.

System Export Targets

Export operations generate formatted outputs dynamically, saving them into clean structures:

  • CSV Exports: Sourced directly from databases and saved via localized helpers (e.g., \\copy ... TO '/tmp/export.csv').
  • JSON Aggregates: Formatted using native DB JSON aggregations (e.g., json_agg in PostgreSQL) saved to /tmp/export.json.
  • Database Dumps: Raw sql outputs (e.g., backup_YYYYMMDD.sql) often compressed utilizing gzip.

DB Explorer Advanced Features

  • Transaction Safety Checks: Prevents accidental destructive execution by wrapping queries inside BEGIN/ROLLBACK blocks, demanding confirmation before committing.
  • Performance Auditing: Evaluates active connection pools, tracks table bloating, analyzes index usage patterns, and isolates slow queries exceeding set thresholds.
  • Schema Hash Generation: Computes quick MD5 hash comparisons to verify structural parity between separate database environments.
  • Multi-Database Migration Helpers: Leverages direct localized pipelines to stream data from source tables directly into separate target engines.
  • Cloud SSL Compliance: Features configuration support for secure cloud environments, designed to integrate smoothly with native setups utilizing Openclaw Skills.

SKILL.md


Loading

Related Openclaw Skills

METADATA

Github Stars: 0
forks: 0

Featured*