pg-dry-run

pg-dry-run

A free, open-source tool that lets AI agents preview exactly what a Postgres write would change — including cascades and constraint hazards — before it actually runs.

🔗 Visit pg-dry-run
📁 Databases & Storage🗣️ English📅 August 31, 2026

Description

Letting an AI agent run database writes directly is risky: an INSERT, UPDATE, or DELETE can silently cascade into related tables in ways that are hard to predict from the query alone. pg-dry-run turns each proposed write into a safe, inspectable preview before anything actually changes.

pg-dry-run converts write operations into read-only transaction previews that show the exact row-level before/after values, flag foreign-key cascades, and warn about trigger or rule side effects. It uses xmin-based row version pinning so a preview can't silently go stale between when it's shown and when it's approved and applied — preventing the classic "preview said X, but by the time you approved it the data had changed" problem. Previews are JSON-serializable, so they can flow through an approval step in a separate process, and it supports custom database drivers, configurable row limits, and operation timeouts. It's MIT-licensed and free.

💬 Our review

The short version: pg-dry-run addresses a real and underserved safety gap — letting AI agents touch production data without blind trust — and being free, open source, and narrowly focused makes it easy to adopt without much risk.

The manual alternative most teams reach for is wrapping writes in a transaction and rolling back to inspect the effect, which works but doesn't give you cascade detection, trigger warnings, or a structured approval workflow the way pg-dry-run does out of the box. Database branching platforms like Neon or PlanetScale solve a related but different problem — giving you an isolated copy of the database to test against — which is heavier infrastructure than pg-dry-run's lightweight preview-then-approve model. If you're building any kind of agent that's allowed to write to a real Postgres database, pg-dry-run's xmin-pinning and structured JSON proposals are a meaningfully safer default than trusting the agent's own judgment or relying on ad hoc rollback scripts.

💰 Pricing

Gratuit (open source)Licence MIT, aucun coût
Open Source Gratuit

📊 Global score

45Average
🌐Availability15/100Faible

1 language · 0 platform

📄Profile75/100Bien

Profile completeness

🤖 AI-enriched data

💰 Pricing model
🆓 Gratuit

Open source sous licence MIT, aucun coût

👥 Target audienceDéveloppeurs d'agents IA, administrateurs de bases de données, équipes conformité
🗣️ Languagesen
🌍 Target countriesMarché anglophone, communauté développeurs internationale
👍

Pros

Prévisualisation ligne par ligne avant/après

Détection des cascades de clés étrangères

Verrouillage de version par xmin pour éviter les écarts entre preview et application

Propositions JSON pour workflow d'approbation externe

👎

Cons

Spécifique à PostgreSQL uniquement

Nécessite d'intégrer le workflow d'approbation soi-même

Projet jeune, pas encore largement adopté

❓ Frequently asked questions

What is pg-dry-run in one sentence?
How much does it cost?
What is xmin-based row pinning?
Does it work with any database?
Is it worth it compared to alternatives?
Which tool should you pick for your case?