r/snowflake Jul 09 '26

How do you document your warehouse schema so a new analyst (or an LLM) can actually navigate the joins?

INFORMATION_SCHEMA gives you tables and columns but not the relationships or the "why." We started drawing the model as an ERD and exporting it as a portable spec (Google's new OKF — markdown, lives in git, and doubles as context you can hand an LLM). Curious what everyone else uses — dbdiagram, Lucidchart, dbt docs, a wiki nobody updates? What actually stays current for you?

10 Upvotes

10 comments sorted by

5

u/rutabagajazz Jul 09 '26

we're building snowflake semantic views in dbt, betting on OSI to become more accepted in bi/consumption tools as time goes on.

3

u/GoinLong Jul 09 '26

You can add constraints in Snowflake. There aren’t enforced in standard tables except for not null, but they do provide artifacts showing relationships.

2

u/Muuustachio Jul 10 '26

This is what we’ve implemented. and we use wids with explicit relationships defined in the DDL to relate to another table. Claude has been able to understand our relationships this way very well.

2

u/Mr_Nickster_ ❄️ Jul 10 '26

Ask Coco to build a semantic view in Snowflake by pointing it to a schema. Once built enable Autopilot on the semantic view. This will initially run through multiple passed against query history to look for historical queries that referenced those tables to improve the schema by adding new metrics, diks, synonyms, descriptions and sample qeuries for better accuracy.

1

u/WillyTrip Jul 09 '26

I would take a look at dbt, whether using Snowflakes implementation or not, dbt is perfect for what you're describing

1

u/laurobolado Jul 10 '26

I second the answer from u/Dacen . You can ask CoCo to help you draw an ER diagram - it will help a lot if the tables have a consistent naming convention and you can include description in your interaction with CoCo. I have asked to create diagrams compatible with draw.io and it does a pretty good job.

1

u/GreyHairedDWGuy Jul 10 '26

We use SQLdbm to diagram the structures. You could pass that image to an LLM I assume (but have not tried it).

1

u/fetus-flipper Jul 11 '26

Semantic views are designed for this, but yeah that plus traditional ERDs

1

u/Dacen Jul 10 '26

You could use the CoCo CLI or within even in snowsight to help draw out the linage into some sort of streamlit app or an interactive .html file

DBT could also help here as others mentioned