Data Relationships
Follow the query to the dependency.
Follow the relationships
One table. More than one dependency.
View definition and the source table
Follow a read from a view into its table.
The view reporting.open_orders selects records from sales.orders. The example application reads the view.
reporting.open_orders → reads → sales.orders
A read relationship connects the view to its source table.
Illustrative SQL definition
CREATE VIEW reporting.open_orders AS SELECT o.id, o.customer_id, o.total FROM sales.orders AS o WHERE o.status = 'open';
Inspect the application excerpt
async function loadOpenOrders(db) {
return db.query(
'SELECT * FROM reporting.open_orders'
);
}Procedure body and its update target
Separate a write from a read.
The example close_order procedure updates sales.orders. The application excerpt shows where it is called.
sales.close_order → writes → sales.orders
Write relationships describe the target of a supported SQL operation. The example does not imply that importing a schema reads customer rows or executes this procedure.
Illustrative SQL definition
CREATE PROCEDURE sales.close_order(IN order_id bigint) LANGUAGE SQL BEGIN ATOMIC UPDATE sales.orders SET status = 'closed' WHERE id = order_id; END;
Inspect the application excerpt
async function closeOrder(db, orderId) {
return db.query(
'CALL sales.close_order($1)',
[orderId]
);
}Two definitions in this example mention status
Bring the related definitions into the review.
In these excerpts, the view filters on status and the procedure updates it. Both are useful evidence when reviewing a change to that column.
sales.orders.status → inspect the related view and procedure
This illustrates an investigation using table relationships and visible column references. It is not a guarantee of complete column-level impact coverage or dynamic SQL resolution.
Illustrative SQL definition
-- View: reporting.open_orders SELECT o.id, o.customer_id, o.total FROM sales.orders AS o WHERE o.status = 'open'; -- Procedure: sales.close_order UPDATE sales.orders SET status = 'closed' WHERE id = order_id;
Inspect the application excerpt
// Application entry points in this example loadOpenOrders(db); closeOrder(db, orderId);
What enters the graph
See the structure. Follow the connections.
Objects & columns
Schemas, tables and the fields they contain, from a connected database or the SQL files in your repository.
Reads, writes & calls
How the views, procedures and triggers in a connected database use those objects.
Your code is in the same graph. Illustrative relationships; coverage depends on the source and supported syntax.
Two ways to start
Different sources. Connected context.
Database catalog
PostgreSQL, Microsoft SQL Server, and MySQL
Objects, definitions, and the read and write relationships between them.
SQL in your repository
Tables, views and procedures defined next to your application code.
Trellis
Your connected graph
Objects, definitions and relationships
What gets imported?
Catalog connections import selected schemas and supported definitions; read and write relationships come from the views, procedures and triggers in that catalog. Repository imports add the tables, views and procedures defined in supported SQL files alongside your code, and link each function in that code to the ones its SQL uses. They add no read and write relationships between the definitions themselves. Coverage depends on dialect, statement shape and target resolution. Catalog import reads schema definitions only, not the rows in your tables.
Turn connections into a better review