LaunchKit · 2026
Back to Skills

sql-query-generator

Generate secure SQL queries with validation, pagination helpers, risk analysis, and audit-focused safeguards.

0
1.0k downloads
by @cerbug45

Setup & Installation

openclaw skills install @cerbug45/sql-query-generator

Or with the ClawHub CLI, for registry-managed skill folders outside a full OpenClaw workspace:

npx clawhub install sql-query-generator

Version History

v0.3.0Feb 21, 2026 - Version note by skill developer:

Add strict table allowlist enforcement helper and policy checks.

What This Skill Does

Converts natural language descriptions into SQL queries across six database systems: PostgreSQL, MySQL, SQLite, SQL Server, Oracle, and MariaDB. All queries use parameterized inputs by default, with built-in injection detection, input validation, rate limiting, and audit logging.

It enforces parameterized queries and injection detection at generation time, catching security issues before they reach a database.

When to use it

  • Translating a business question into a JOIN query without writing SQL manually
  • Generating paginated report queries for admin dashboards
  • Building parameterized search queries for user-facing web forms
  • Auditing database access logs for suspicious query patterns
  • Creating data migration scripts with validated INSERT and UPDATE statements

Example Workflow

Here's how your AI assistant might use this skill in practice.

INPUT

User asks: Show all customers who spent over $500 in Q1 2024

AGENT
  1. 1Parse natural language to identify required tables, filter conditions, and aggregation logic
  2. 2Generate a parameterized SQL query using JOIN and SUM with placeholders for the date range and spending threshold
  3. 3Run injection pattern detection on any dynamic identifiers
  4. 4Append index recommendations and a LIMIT clause for large datasets
  5. 5Return the formatted query, parameter list, expected result structure, and a language-specific execution example
OUTPUT

A complete parameterized SQL query with documented parameters, performance notes, and a psycopg2 or mysql-connector code snippet for immediate use