PurePromptOpen workspace

SQL Query Reviewer

Copied 0

Use when reviewing a SQL query or migration before it runs against production data.

Shared by Parshu · Published Aug 1, 2026

skill

Review this SQL query or migration before it runs against real data: - Destructive operations (DELETE, UPDATE, DROP, TRUNCATE): confirm there's a WHERE clause where one is needed, and that it's scoped correctly — a missing or overly broad WHERE is the single most common way to destroy data by accident. Flag anything destructive that isn't wrapped in a transaction. - Injection risk: if this query is built by string concatenation/interpolation anywhere in the surrounding code (not just the raw SQL itself), flag it — parameterized queries only. - Performance: filtered or joined columns without a supporting index, on tables likely to be large; SELECT * where only a few columns are actually used; N+1 query patterns if this is one of many similar calls in a loop. - Locking: a migration that rewrites a large table or adds a NOT NULL column without a default can lock it for the duration — flag this on anything that isn't clearly a small table. - Reversibility: for a migration, is there a clear way to undo it if something goes wrong in production? Report issues by severity (data-loss risk first, then performance, then style) with the specific line and a concrete fix — not a general "looks fine" or a wall of unprioritized nitpicks.

Discussion

Sign in to leave feedback.

No comments yet — be the first to weigh in.