Skip to Content
Back to templates
// Template · Governance

View Dependency Analysis with SQL Parser

Reads all view definitions from your PostgreSQL database, parses each SQL with the Putki SQL Parser plugin to extract table and column dependencies, and writes a full lineage report — so you always know which views break before you change a table.

Governance Lineage PostgreSQL 4 transforms Apache Hop
Download .hpl
Apache Hop pipeline
Created Jan 23, 2026
Putki 2026.03+
Pipeline
read-view-definitions
TableInput
SQL Parser
Putki
parse-sql
SqlParser
sort-by-view-and-table
SortRows
write-lineage-report
TableOutput
How it works

Before changing a table in your database, you need to know which views reference it — or risk breaking them silently. This pipeline reads every view definition directly from information_schema, parses the SQL with the Putki SQL Parser plugin, and writes a complete lineage report: which view references which table and which column.

1
Read view definitions from the database
The pipeline queries information_schema.views directly — no manual steps. Each row contains the view name and its full SQL definition, ready to be parsed.
2
Parse the SQL
The Putki SQL Parser transform processes each view's SQL and extracts every table and column reference — including those inside JOINs and subqueries. It produces one output row per dependency found.
3
Write the lineage report
Results are sorted by view and table, then written to a view_lineage reporting table. The table is truncated on each run so the report always reflects the current state of your database.
How to use the output
Before dropping a table
Query SELECT * FROM view_lineage WHERE dep_table = 'your_table' to see every view that will break.
Before renaming a column
Query WHERE dep_table = 'your_table' AND dep_column = 'your_column' to find every affected view.
As a scheduled audit
Run on a schedule to keep the lineage report current. Connect downstream to a Chat alert if any views reference deprecated tables.
What you need
·
Putki subscription
Access to the SQL Parser plugin, included in all Putki tiers.
·
A PostgreSQL database connection
A Hop database connection with read access to information_schema.views and write access to the schema where the view_lineage table will be created.
·
Target table
Create the view_lineage table before the first run, or let the pipeline create it automatically if your connection has DDL permissions.
Required plugins SQL Parser SQL Parser
Details
Type
Pipeline (.hpl)

Transforms
4

Putki version
2026.03+

Created
May 6, 2026
Use case
Automatically document which views depend on which tables and columns. Run before any schema change to know the impact before it happens.
Schedule suggestion
Run on demand before schema changes, or schedule weekly to keep the lineage report current.