Edit Your SQL and See What Breaks: What-If Impact Analysis

The usual order of events is: change a model, run the pipeline, and find out what broke from a failing job or an angry message. What-if impact analysis reverses it. You make the change on a copy first, and the tool tells you which tables and columns depend on what you touched. Here is how that works in the SQL lineage analyzer, with a real dbt-style example and the exact messages it produces.

Open the SQL Lineage Analyzer

The scenario

A small dbt project. Customers and orders come from raw sources, get cleaned in staging, combined in an intermediate model and published as a mart and a dashboard table:

raw_customers --> stg_customers --> int_customer_orders --> dim_customers --> customer_dashboard
raw_orders    --> stg_orders    --/

You want to rename customer_id to cust_id in stg_customers. It looks like a one-line change. The question is who reads that column.

Step by step

  • Load the project in the SQL lineage analyzer: drop the folder, a ZIP, or paste a public GitHub link. Nothing is uploaded; the files are read in your browser.
  • Below the graph, open **Project files** and click the file you plan to change, here stg_customers.sql.
  • Press **Edit** and make the change. The graph and the analysis update about half a second after you stop typing. A small amber dot marks the files you edited.
  • Read the card under the graph, **What your edits would affect**. It ranks the findings as will likely break, risky, or for information.
  • When you are done, **Copy summary (Markdown)** for a pull request, or **Undo all edits** to go back. Your own files are never changed.

Example 1: rename a column

Changing the first line of stg_customers to select customer_id as cust_id gives this result:

High risk: 1 breaking, 0 risky. Reaches 3 downstream tables and 3 columns.

Will likely break
  stg_customers.customer_id: Column renamed customer_id -> cust_id.
  3 downstream columns still use the old name.
  downstream: customer_dashboard, dim_customers, int_customer_orders

Two things are worth noticing. The tool recognised a rename, not a drop plus an add, because the new column is built from the same source with the same expression. And it follows the column through every hop: int_customer_orders reads it directly, dim_customers reads that, and customer_dashboard reads that. Nobody had to remember the dashboard.

Example 2: drop a column

Removing email from stg_customers, in a project that also has a hashed audience model and a count model, reports:

High risk: 1 breaking. Reaches 4 downstream tables and 4 columns.

Will likely break
  stg_customers.email: Column email was removed but 3 columns still read it.
  downstream: dim_customers, email_count, int_customer_orders, marketing_audience

The three direct readers are the ones that will fail on the next run. dim_customers is listed too because it reads int_customer_orders, which reads the missing column.

Example 3: change a data type

Change cast(amount as numeric(10,2)) to cast(amount as int) in a model and you get a medium-risk finding: the data type of amount may have changed, from numeric(10,2) to int. Nothing fails to run, which is exactly why it is risky: the values change silently, and every downstream sum or average moves with them.

What it checks

  • A column that was dropped or renamed while something still reads it (will likely break).
  • A table that was removed while something still reads it.
  • A data type that changed in a cast.
  • A calculation that changed, or a column now built from different sources, with the number of downstream columns that read it.
  • Tests that were removed from your dbt YAML.

A calculation counts as changed when the expression differs after formatting is ignored. Whitespace, letter case and table aliases do not count, so reformatting a query does not create noise.

Put it in the pull request

Copy summary (Markdown) produces the findings, the downstream tables and the size of the blast radius as text. Paste it into the pull request description so the reviewer sees what the change reaches without opening anything. For the underlying idea, see what breaks if I change a SQL table and SQL column impact analysis.

What it cannot see

Be clear about these before you trust a clean result:

  • It only knows the SQL you loaded. A dashboard, notebook or another repository that reads your table is invisible to it.
  • Columns used only in a JOIN or WHERE condition are not column links, so a change to a filter or a join key is not reported.
  • Jinja is not rendered and macros are not expanded. A column produced by a macro that generates columns cannot be followed.
  • Dynamic SQL built from strings at run time cannot be followed.
  • A renamed model shows up as one removed and one added table, not as a rename.

Treat the result as a fast first pass that catches the most common mistakes, a dropped or renamed column, and keep your tests in CI as the final check.

Open the SQL Lineage Analyzer

Related tool pages

  • dbt Lineage Viewer for Your SQL Models: Drop your dbt models folder and see the lineage graph from sources through staging to marts, with column links. No dbt run, no warehouse. Free, private.
  • SQL Column Lineage Tool: See which source columns build every column of a view or table across many SQL files. Trace to the raw table or forward to dependants. Free, in your browser.
  • SQL File Dependency Analyzer: Find out which SQL file must run before which, from the tables each file creates and reads. Get a run order, circular dependencies and tables nothing uses.
  • SQL Impact Analysis: What Breaks If a Table Changes: Pick a table and see everything downstream that depends on it, and every upstream source it is built from. Works across a whole folder of SQL files, free.
  • SQL File Lineage Tool: Free SQL file lineage tool: drop a folder of .sql files and see which file feeds which table, column by column. Nothing is uploaded.
  • SQL Query Visualizer: Free SQL query visualizer: paste a query or drop SQL files and see tables, joins and columns as a clear diagram. Runs in your browser, no upload.

Also try

How to use the SQL Lineage Analyzer: step by step

  1. Load your SQL or dbt project in the SQL lineage analyzer.
  2. Open Project files, pick a model and press Edit.
  3. Make the change and read What your edits would affect.
  4. Copy the Markdown summary, then press Undo all edits.

When to use the SQL Lineage Analyzer

  • Check a column rename before you merge
  • Find what a dropped column breaks
  • Size a refactor
  • Write a change summary for a pull request

Example

Input: models/ folder: raw schema, staging views, marts, reports (7 .sql files)

Output: A graph of 10 tables and views, 40 column links and the order to run the files

Frequently asked questions

How do I see what breaks if I change a SQL column?

Load the project in the SQL lineage analyzer, open Project files, choose the file and press Edit. Make the change and a card lists the downstream tables and columns that would break.

Does editing change my real files?

No. Edits stay in your browser. Undo all edits restores the originals, and your own files are never touched.

Can it tell a rename from a dropped column?

Yes, when the new column is built from the same source with the same expression. It then reports a rename and tells you how many columns still use the old name.

Does it need a database or dbt to run?

No. It reads the SQL text, so there is no warehouse connection and no dbt run.

Will it find dashboards that use my table?

No. It only sees the SQL files you load. Check BI tools and other repositories separately.

Tip: Make the change in the staging model, the earliest place it can happen. The further upstream you edit, the more the result tells you.