dbslice
Extract minimal, referentially-intact database subsets for local development and debugging.
The Problem
Copying an entire production database to your machine is infeasible. But reproducing a bug often requires having the exact data that caused it. dbslice solves this by extracting only the records you need, following foreign key relationships to ensure referential integrity.
Quick Start
# Install globally uv tool install dbslice # or: pip install dbslice # Extract an order and all related records dbslice extract postgres://localhost/myapp --seed " orders.id=12345 " > subset.sql # Import into local database psql -d localdb < subset.sql
Features
Zero-config start -- Introspects schema automatically, no data model file required
-- Introspects schema automatically, no data model file required Single command -- Extract complete data subsets with one CLI invocation
-- Extract complete data subsets with one CLI invocation Safe by default -- Auto-detects and anonymizes sensitive fields (emails, phones, SSNs, etc.)
... continue reading