Finding the right JOIN shouldn't be the hardest part of building a dbt model.
Yet when working with an unfamiliar database, developers often spend more time investigating relationships than writing SQL.
You know what data you need. You just don't know exactly how to connect it.
That's a problem we've been working on with IntaLink for dbt, a VS Code extension that brings database relationship intelligence into the SQL development workflow.
We've also recently launched an interactive playground where developers can explore the JOIN suggestion workflow directly in their browser.
Try the Interactive Demo — No Installation Required
The Problem with Traditional SQL Completion
Most SQL completion tools help developers find table names, column names, and SQL keywords.
That's useful when you already understand your database.
But consider this situation:
SELECT
o.order_id,
o.order_amount,
c.customer_name
FROM {{ ref('stg_orders') }} AS o
LEFT JOIN ...
You know you need customer information.
But which customer model should you use? Which columns establish the relationship? Is the relationship already used somewhere else in your dbt project?
Traditional autocomplete may show you a list of available tables.
What you really need is information about how those tables are connected.
That's the difference between schema-aware completion and relationship-aware completion.
1. Discover Relationships Beyond Foreign Keys
Many enterprise databases don't have complete foreign key definitions.
Related fields may also have completely different names:
orders.customer_ref
customers.customer_id
IntaLink Cloud analyzes authorized database metadata and column-value evidence to identify candidate relationships.
Developers can explore these relationships through a visual graph, inspect the evidence, and review the results.
Discovered relationships provide a foundation for understanding unfamiliar database structures.
Instead of relying entirely on naming conventions, developers have additional data evidence to investigate potential connections.
2. Get JOIN Suggestions Where You Write SQL
The VS Code extension uses reviewed relationship information from IntaLink Cloud.
When you type JOIN, it can suggest related tables and dbt models.
When you type ON, it can suggest eligible JOIN conditions based on the available relationships and SQL aliases.
For example:
LEFT JOIN {{ ref('stg_customers') }} AS c
ON o.customer_ref = c.customer_id
Relationship-aware suggestions appear directly in the SQL development environment.
The idea is straightforward: reduce the need to switch between database browsers, documentation, and existing SQL files just to find a candidate JOIN.
3. Understand Why a JOIN Is Suggested
A suggestion without evidence is still something a developer needs to investigate.
IntaLink for dbt can display supporting relationship information, including:
- Value inclusion rates.
- Distinct-value statistics.
- Inferred cardinality.
- Relationship classification.
- Review status.
- Existing model usage, where available.
Developers can inspect the evidence behind a suggested JOIN condition.
This is particularly useful when multiple columns appear to be potential JOIN keys.
Matching values alone do not prove business meaning. But having the evidence available makes it easier to evaluate the relationship.
4. Flag Potential JOIN Risks
Finding a relationship doesn't mean every JOIN using that relationship will produce the intended result.
A valid SQL statement can still introduce unexpected row multiplication or change the analytical grain of a model.
IntaLink for dbt can flag certain potential JOIN risks directly in VS Code, giving developers an opportunity to investigate before relying on the results.
It complements existing dbt tests and developer judgment rather than replacing them.
5. Reuse Relationships Across dbt Models
Database relationships shouldn't become inaccessible simply because a column has been renamed.
IntaLink for dbt supports relationship lineage inheritance across eligible transformations, including certain column renames, casts, CTEs, SELECT *, and nested ref() calls.
This allows previously discovered relationship information to remain useful across supported model transformations.
Calculated expressions are not automatically assumed to preserve the original relationship.
The goal is to make relationship knowledge reusable as dbt projects evolve.
Try It Directly in Your Browser
Setting up a new developer tool can take time.
That's why we've created an interactive playground for IntaLink for dbt.
You can explore a guided simulation of the JOIN suggestion workflow without installing the extension, configuring a dbt environment, or connecting your database.
If you find the workflow useful and want to explore it in your own dbt project, the extension is available on the VS Code Marketplace:
I'd be interested in hearing how other developers currently handle relationship discovery in dbt.
How much of your time goes into writing SQL, and how much goes into figuring out which tables should be connected?




Top comments (0)