FOREIGN KEYS & BLAST RADIUS ← All Developer Tools
Foreign-Key ON DELETE CASCADE Blast Radius & Insert Order Simulator
Simulate foreign-key delete cascades, orphan traps, and topological parent-to-child insert order from your SQL, Prisma, or SQLAlchemy schema without reading a single row.
Simulate Cascade Blast Radius → Run in CLI Sandbox → Launch Full Console
The Engineering Problem
A single misplaced ON DELETE CASCADE on a parent table like users or tenants can silently wipe out invoices, audit logs, and ledger history across 10 downstream tables.
CREATE TABLE invoices ( id UUID PRIMARY KEY, user_id UUID REFERENCES users(id) ON DELETE CASCADE );
[HIGH] Destructive ON DELETE CASCADE from users -> invoices Deleting a user wipes financial history. Suggested fix: Change ON DELETE CASCADE to ON DELETE RESTRICT and add deleted_at TIMESTAMPTZ NULL.
Run 100% Offline in Your Terminal or CI
pip install solunex-ssdo ssdo review ./schema.sql
What SSDO Checks & Generates
- Computes exact multi-hop delete blast radius across declared and inferred foreign keys.
- Outputs deterministic topological insert order so seed scripts and tests never fail FK constraints.
- Offers 1-click SQL patches to replace dangerous CASCADE rules with RESTRICT + soft-delete columns.
- Runs 100% on schema structure with zero database row queries.
Frequently Asked Questions
How does SSDO find relationships if foreign keys are missing?
SSDO separates declared database foreign keys from heuristic inferences (such as user_id -> users.id) and explicitly labels each link with its evidence and confidence.
Does it work on Prisma or SQLAlchemy models?
Yes. Drop your .sql, .prisma, or Python SQLAlchemy files directly into the Schema IDE to simulate insert order and cascade blast radius.
More Zero-Row Developer Tools
- PostgreSQL Zero-Downtime Migration & Rollback SQL Generator
- SQL & SQLAlchemy to FastAPI + Pydantic v2 Code Generator
- Audit Existing FastAPI, Express & Next.js Routes Against Your SQL Schema
- SQL Schema to OpenAPI 3.1 & Next.js / Zod Route Generator
- SQLAlchemy, Prisma & Drizzle Schema Visualizer & ERD Explorer
- SQL QueryDoctor: Zero-Row Query, ESR Index & EXPLAIN Plan Analyzer