oncokb-database-review

Review database code changes for N+1 queries, SQL injection, and pagination ordering defects.

Updated Aug 31, 2026
One-click install
npx skills add https://github.com/oncokb/oncokb-skills --skill oncokb-database-review-oncokb
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: oncokb-database-review
Source: https://github.com/oncokb/oncokb-skills/tree/main/skills/oncokb-database-review
Command: npx skills add https://github.com/oncokb/oncokb-skills --skill oncokb-database-review-oncokb

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Database code changes often introduce hidden performance and security defects—N+1 query loops, SQL injection vectors, and non-deterministic pagination—that slip through manual review and cause production incidents. ## Core Features & Use Cases - N+1 Query Detection: Identifies loop-driven query patterns and ORM lazy-loading in serializers, recommending batching or eager loading fixes. - SQL Injection Auditing: Flags string interpolation and dynamic SQL built from user input, requiring parameterized queries or strict allowlists. - Pagination Determinism Checks: Verifies every paging query includes a unique tie-breaker column in ORDER BY to prevent rows shifting between pages. - Use Case: During a PR review of a new API endpoint with ORM queries and cursor pagination, run this review to catch a missing unique tie-breaker and an unsafe dynamic ORDER BY clause before merge. ## Quick Start Review the database access changes in this pull request for N+1 queries, SQL injection risks, and pagination ordering issues.

Frequently Asked Questions about oncokb-database-review

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I detect N+1 queries in code review?▼

Look for loop-driven query patterns where an initial query triggers per-row follow-up queries, especially ORM lazy-loading inside loops or serializers. Fix them with batching, eager loading, join-based fetches, or precomputed maps.

How to prevent SQL injection in dynamic queries?▼

Use parameterized queries or prepared statements for all user-influenced input. When dynamic SQL is unavoidable, such as dynamic ORDER BY clauses, enforce strict allowlists for identifiers and operators instead of concatenating request values.

Why does pagination return duplicate or missing rows?▼

Pagination breaks when ORDER BY lacks a unique tie-breaker, so rows with equal sort keys shift between pages. Always append a unique column like id to the ordering to guarantee deterministic results across pages.

What should a database code review checklist include?▼

Cover N+1 query risks, SQL injection via unparameterized input, and deterministic pagination ordering as required checks. Also verify supporting indexes, transaction scope, lock contention, soft-delete predicates, and migration safety for high-risk changes.

When should I not rely on manual database review alone?▼

Manual review catches logic-level issues but cannot measure actual query counts or execution plans under load. Combine it with query logging, APM tracing, and load testing for high-traffic endpoints and concurrency-sensitive write paths.