sql-query-reviewer for Openclaw

A professional-grade SQL auditor that reviews queries for performance bottlenecks, security vulnerabilities, and dialect-specific correctness.

lnguyen1996
v1.0.0
Mar 22, 2026
0
944
0

Install & Download

1. ClawHub CLI

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

npx clawhub@latest install sql-query-reviewer

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 sql-query-reviewer 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 sql-query-reviewer?

The sql-query-reviewer is a specialized diagnostic tool designed for developers who need to ensure their database interactions are production-ready. As a standout entry in the Openclaw Skills library, it goes beyond simple syntax checking to perform deep architectural analysis of SQL statements across all major dialects including PostgreSQL, MySQL, and BigQuery.

By integrating this skill into your workflow, you gain an automated peer reviewer capable of identifying silent killers like Cartesian joins, non-SARGable queries, and dangerous string interpolations. It doesn't just point out flaws; it provides structured reports with side-by-side 'Before' and 'After' code rewrites to immediately level up your codebase.

sql-query-reviewer Use Cases

  • Identifying SQL injection risks in raw queries or dynamic SQL blocks.
  • Optimizing slow-running queries that are causing performance bottlenecks in production.
  • Auditing ORM-generated SQL to catch N+1 query patterns before they scale.
  • Reviewing database migration files for missing indexes or improper join types.
  • Converting legacy ANSI SQL to dialect-specific optimized syntax.

How sql-query-reviewer Works

  1. The user provides a raw SQL query, migration file, or ORM output to the agent.
  2. The agent analyzes the input against a comprehensive checklist covering correctness, security, performance, and style.
  3. The skill evaluates the query context, such as table sizes and dialect-specific features (e.g., CTEs vs subqueries).
  4. A structured report is generated, categorizing findings by severity from Critical to Suggestions.
  5. Optimized SQL rewrites are provided for every identified issue to ensure immediate actionability.

sql-query-reviewer Setup

To start using this skill within your environment, ensure your agent has access to the Openclaw Skills repository and use the following command structure:

# Example of triggering a review for a PostgreSQL query
claw run sql-query-reviewer --query "SELECT * FROM users WHERE id = '" + user_id + "'" --dialect postgres

sql-query-reviewer Data Schema & Taxonomy

The skill organizes its findings into a clear hierarchy based on risk and impact. The data taxonomy used for reporting is outlined below:

Severity Focus Area Description
Critical Security & Logic SQL injection, data loss risks, and logic bugs (e.g., IS NULL vs = NULL).
Performance Scalability Full table scans, missing indexes, and N+1 patterns.
Suggestion Maintainability Style consistency, CTE usage for readability, and aliasing.
Correctness Logic JOIN types, GROUP BY validation, and timezone arithmetic.

sql-query-reviewer Advanced Features

  • Dialect Awareness: Supports PostgreSQL, MySQL, SQLite, T-SQL, Oracle, BigQuery, and Snowflake.
  • Self-Learning Anti-Patterns: Automatically tracks frequent issues and surfaces the top 3 SQL anti-patterns after every 20 reviews.
  • Contextual Awareness: Adjusts recommendations based on provided table sizes and whether the query is in a high-traffic 'hot path'.
  • Side-by-Side Rewrites: Provides immediate, copy-pasteable 'Before' and 'After' snippets for all critical and performance fixes.

SKILL.md


Loading

Related Openclaw Skills

METADATA

Github Stars: 0
forks: 0

Featured*