/sql-quality:sql-params-generatefrom sql-quality
Generates parameter files for sql-quality by finding unbound :name placeholders in SQL files and populating them with real database values for EXPLAIN analysis.
Ships in sql-quality. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Give every :name placeholder of a SQL directory a value, so sql-quality can EXPLAIN the statements.
$ARGUMENTS: the SQL directory, optionally the params file to write (default <dir>/params.json).
SQ=vendor/bin/sql-quality; [ -x "$SQ" ] || SQ=bin/sql-quality
$SQ analyze --sql-dir=<dir> [--params=<existing params file>]
Every skipped entry UnboundParameter: a, b names the parameters a file still needs. Entries for
EmptyListParameter need a non-empty list. Keep the parameters an existing file already has.
Run these lookups against the development or test database sql-quality analyzes, never a large
production one: without an index they read the whole table.
Read the statement, find the column each placeholder is compared with, and take a real value:
SELECT status, COUNT(*) FROM posts GROUP BY status ORDER BY 2 DESC LIMIT 5;
SELECT MIN(created_at), MAX(created_at) FROM posts;
try-index result.IN (:list): a JSON array of two to five existing values.LIMIT / OFFSET: integers, not strings.LIKE: the pattern the application builds, wildcards included.price * :tax_rate) has no column to read: take the value the
application sets, from its configuration or code, and ask the user when it cannot be found.Prefer values that return some rows: /sql-quality-fix needs rows to check a rewrite.
JSON keyed by SQL file name; files without placeholders need no entry.
{
"1_full_table_scan.sql": {"min_views": 1000},
"2_filesort.sql": {"status": "published", "limit": 10},
"15_listed_parameters.sql": {"listed_params": ["User 1", "User 10"]}
}
A PHP file returning the same array also works (--params=params.php).
Run step 1 again with --params=<file>. No UnboundParameter or EmptyListParameter may remain.
Report the other skipped entries (DDL, syntax errors) as they are.
What SKILL.md sets; muted values are Claude Code's defaults
3 skills in this plugin
/sql-quality-checkCheck SQL files for MySQL performance problems (full table scans, ineffective joins, filesorts, functions on indexed columns, implicit conversions and more) and report them, CI style, without changing anything. Use when asked to check, lint or review the SQL of a project, or to gate a change on new SQL problems./sql-quality-fixFix MySQL performance problems in SQL files and prove each fix - rewrites are checked to return the same rows, indexes are measured as invisible indexes before anyone adds them. Use when asked to fix, optimize or speed up the SQL of a project.npx claudepluginhub koriym/koriym.sqlquality --plugin sql-quality