Generate FK cascade graph
generate_fk_cascade_graphVisualize foreign-key cascade chains in a database schema to identify write blast radius from CASCADE, SET NULL, or SET DEFAULT actions on DELETE/UPDATE. Returns a Mermaid graph LR diagram.
Instructions
Build a Mermaid graph LR of foreign-key cascade chains in a schema. Each edge runs from the referencing table to the referenced table, labelled with the cascade action(s) on DELETE / UPDATE. By default only FKs with at least one CASCADE / SET NULL / SET DEFAULT action are included — those are the ones that produce a write blast radius. Pass include_all=true to include NO ACTION / RESTRICT FKs too (full FK topology view). Cross-schema FK targets are rendered as separate nodes prefixed with their schema. Returns the Mermaid graph LR diagram as a string.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| schema | Yes | ||
| database | No | Optional: target a configured secondary (read-only) database by name; omit for the primary. Call list_databases to see the configured ids. | |
| include_all | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |