From sql-quality
Generate parameter bindings for SQL files by analyzing database schema and extracting SQL placeholders. Queries the live database for table structures, matches placeholders to column types, and generates appropriate test values based on column patterns (IDs, dates, status enums, etc).
How this skill is triggered — by the user, by Claude, or both
Slash command
/sql-quality:sql-params-generateThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Generate parameter bindings for SQL files by analyzing database schema and SQL placeholders.
Generate parameter bindings for SQL files by analyzing database schema and SQL placeholders.
$ARGUMENTS: SQL directory path (e.g., "tests/sql")Query the database directly for the latest schema:
-- Get all tables
SHOW TABLES;
-- For each table, get columns
SELECT column_name, data_type, column_type, column_key
FROM information_schema.columns
WHERE table_schema = DATABASE() AND table_name = 'table_name';
-- Or use SHOW CREATE TABLE for complete DDL
SHOW CREATE TABLE table_name;
For each .sql file in the directory:
:param_name or ? style)| Column Pattern | Type | Generated Value |
|---|---|---|
*_id, id | INT | rand(1, 1000) |
status | VARCHAR/ENUM | Pick from actual ENUM values or common: 'active', 'pending' |
email | VARCHAR | '[email protected]' |
name, title | VARCHAR | 'Test Value' |
*_at, *_date | DATETIME/DATE | '2024-01-01' |
price, amount, total* | DECIMAL | 100.00 |
count, quantity, limit | INT | 10 |
is_*, has_* | TINYINT | 1 |
content, body, text | TEXT | 'Sample text content' |
Output to {sql_dir}/../params/sql_params.php:
<?php
declare(strict_types=1);
return [
'1_full_table_scan.sql' => ['min_views' => 1000],
'2_filesort.sql' => ['status' => 'published', 'limit' => 10],
// SQL files without placeholders use empty array
'12_select1.sql' => [],
];
Use the same connection settings as sql-quality:
mysql:host=127.0.0.1;dbname=testrootOr read from environment / config file if available.
npx claudepluginhub koriym/koriym.sqlquality --plugin sql-qualityGenerates idempotent TypeScript/SQL seed scripts from Drizzle, Prisma, or SQL schemas with realistic data respecting FKs, constraints, and D1 limits. For dev/demo/test DB population.
Analyzes PHP code for SQL injection vulnerabilities including query concatenation, variable interpolation, dynamic identifiers, ORM misuse (Doctrine, Eloquent/Laravel), raw queries, and LIKE/IN issues.