queryDB-skill for Openclaw

A specialized database skill for executing SQL queries and automatically generating interface test cases from real MySQL or PostgreSQL data.

squidtestgary
v1.0.0
Apr 7, 2026
0
684
0

Install & Download

1. ClawHub CLI

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

npx clawhub@latest install querydb-skill

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 querydb-skill 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 queryDB-skill?

The queryDB-skill is a robust technical utility designed for developers and QA engineers who need to bridge the gap between live database environments and automated testing. As a key component of Openclaw Skills, it provides a seamless interface for connecting to MySQL and PostgreSQL databases to retrieve samples, verify data integrity, and inject real-world values into test fixtures.

By leveraging this skill, teams can move away from hardcoded test data and instead use live, scenario-based records. It simplifies complex data mapping logic, such as the specific requirements for invoice types and tax codes, ensuring that interface parameters are always accurate and reflect the current state of the database schema.

queryDB-skill Use Cases

  • Executing general SQL queries (SELECT, COUNT) against MySQL and PostgreSQL databases for data validation.
  • Injecting real-world database records into test cases using the db_fixture pattern to replace placeholders with live values.
  • Generating automated interface test cases by mapping database fields to API request parameters.
  • Creating comprehensive test suites for invoice-related systems based on specific tax and invoice number rules.
  • Performing bulk test case generation from complex database scenarios for regression testing.

How queryDB-skill Works

  1. Establish a secure connection to the target MySQL or PostgreSQL database using the provided credentials via the DatabaseClient.
  2. Define SQL queries to target specific data subsets, such as the bw_jms_main1 table for invoice management.
  3. Utilize the mapping logic to translate database column names (like INV_KIND or E_INV_NUM) into the desired interface input parameters.
  4. Process records through specialized generators like TestCaseGenerator to produce JSON-formatted test configurations.
  5. Output the finalized test cases into a standardized format compatible with automated testing frameworks supported by Openclaw Skills.

queryDB-skill Setup

To get started with this skill, install the necessary database drivers via pip:

# For MySQL support
pip install pymysql

# For PostgreSQL support
pip install psycopg2-binary

Ensure your database credentials (host, port, user, password) are correctly configured in your scripts.

queryDB-skill Data Schema & Taxonomy

The skill primarily interacts with the bw_jms_main1 table and exports data in JSON format. Below is the primary mapping logic for invoice-related Openclaw Skills data:

Data Type Database Field Interface Parameter
Tax Invoice INV_KIND, INV_NUM invoiceCode, invoiceNumber
Digital Invoice E_INV_NUM invoiceNumber (20-digit)
Taxpayer Info BUYER_TAXNO taxNo
Seller Info SELLER_TAXNO salesTaxNo

queryDB-skill Advanced Features

  • Smart SQL Placeholders: Automatically replaces variables like {{buyer_tax_no}} at runtime for dynamic querying.
  • Multi-Row Safety Check: Built-in count validation that skips scenarios exceeding a safe threshold (default 500 rows) to prevent performance degradation.
  • Scenario-Based Batching: Generate hundreds of test cases at once using a list of defined scenarios and mapping rules.
  • Automatic Time Range Filtering: Simplifies queries by automatically appending date-based limits (e.g., last 90 days) to prevent processing stale data.
  • Comprehensive Export: Directly saves generated test suites into JSON format ready for consumption by other Openclaw Skills.

SKILL.md


Loading

Related Openclaw Skills

METADATA

Github Stars: 0
forks: 0

Featured*