db-dry-run

Validates SQL migration files by executing them inside a rolled-back PostgreSQL transaction.

3|Updated Feb 7, 2026
One-click install
npx skills add https://github.com/gabrielnsmnto/kord-aios --skill db-dry-run-gabrielnsmnto
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: db-dry-run
Source: https://github.com/gabrielnsmnto/kord-aios/tree/main/src/features/builtin-skills/kord-aios/database/db-dry-run
Command: npx skills add https://github.com/gabrielnsmnto/kord-aios --skill db-dry-run-gabrielnsmnto

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Applying a database migration without testing it first risks syntax errors, missing dependencies, or broken ordering that can leave your schema in a bad state. This Skill runs your migration inside a BEGIN...ROLLBACK transaction so errors surface without any changes being persisted. ## Core Features & Use Cases - Transactional Dry-Run: Executes the migration file with psql inside a transaction that always rolls back, leaving the database untouched. - Error Diagnosis: Reports common failures such as missing relations, missing functions, and syntax errors with concrete fixes. - Use Case: Before applying a new Supabase migration that creates tables, functions, and triggers, run a dry-run to confirm the SQL is valid and objects are created in the correct order, then take a snapshot and apply it for real. ## Quick Start Run a dry-run of the migration file at supabase/migrations/20240101_add_users.sql to verify it executes cleanly before applying it.

Frequently Asked Questions about db-dry-run

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

FAQPage Schema
How do I test a SQL migration without applying it?▼

Run the migration inside a transaction that is rolled back at the end. Using psql with ON_ERROR_STOP=1, wrap the migration file between BEGIN and ROLLBACK so any error aborts execution and no changes are persisted to the database.

How to validate PostgreSQL migration syntax before deployment?▼

Execute the migration file with psql in a rolled-back transaction against a real database connection. This catches syntax errors, missing relations, and ordering issues that static linting cannot detect.

Does a migration dry-run check data correctness?▼

No. A dry-run validates SQL syntax, object dependencies, execution order, and constraint violations, but it does not validate data correctness or check query performance. Those require separate testing after the migration is applied.

Why does my migration fail with relation does not exist?▼

This error means the migration references a table or view that has not been created yet. Create the dependent objects first, and order the migration so tables come before functions and triggers that reference them.

What are the limitations of running migrations in a rolled-back transaction?▼

A rolled-back transaction cannot catch issues that only appear with real data, such as performance problems or data-specific constraint conflicts. Some operations like certain concurrent index builds also cannot run inside a transaction block.