Lineage Graph & Impact Analysis
Modifying a table or column in enterprise databases is often one of the riskiest tasks in software engineering. A seemingly harmless rename can invalidate views, break procedures across external schemas, and trigger silent failures.
LEAI addresses this challenge by compiling a cross-schema dependency graph and providing automated impact analysis.
π How Lineage Tracing Works
The leai trace <OBJECT> command inspects both directions:
graph LR
subgraph Upstream [What feeds into this object?]
A[BASE_TABLE] --> B[CONSOLIDATED_VIEW]
end
subgraph Target [Target Object]
B --> C[CALCULATION_PROCEDURE]
end
subgraph Downstream [What breaks if it changes?]
C --> D[BILLING_PACKAGE]
C --> E[AUDIT_TRIGGER]
D --> F[NIGHTLY_JOB]
end
style C fill:#f96,stroke:#333,stroke-width:2px - Upstream (Ancestors): Which tables, views, and synonyms supply data or logic to this entity.
- Downstream (Descendants): Which views, packages, triggers, and procedures will fail if this entity's signature or structure changes.
π¦ Automated Risk Scoring
For every traced object, LEAI calculates an automated impact severity score based on the count and criticality of downstream dependents:
| Risk Level | Visual Indicator | Typical Criteria |
|---|---|---|
LOW | π’ Green | Leaf entity with zero downstream dependents (or a single simple view). |
MEDIUM | π‘ Yellow | Moderate dependents (2 to 4), without mission-critical triggers or monolithic packages. |
HIGH | π Orange | Multiple materialized views, core packages, or cross-schema dependencies. |
CRITICAL | π΄ Red | High-traffic hub object with dozens of downstream consumers, cascading triggers, or vital financial packages. |
π» CLI Usage Example
LEAI outputs: 1. A formatted summary table with calculated risk rating and total affected entities. 2. The hierarchical list of upstream and downstream dependencies. 3. The corresponding Mermaid.js diagram ready to embed into documents or PR reviews.