querying-the-dbt-information-schema
Installation
SKILL.md
Querying the dbt Information Schema
The dbt Information Schema is a set of SQL views over your project's metadata: models, sources, tests, columns, DAG edges, configs, and run results. You query it with DuckDB SQL, locally, without touching the warehouse.
Use it to answer "what is in this project" questions with one SQL query, instead of grepping YAML or loading a 70 MB manifest.json.
Contents
| You want to… | Go to |
|---|---|
| Check the project can use this | Prerequisites |
| Answer a one-off question | Route A: dbt show (default) |
Run many queries, script them, or use run_results_latest |
Route B: DuckDB on the parquet files |
| Avoid wrong answers from tricky columns | Column gotchas |
| Understand why a view is empty | What is populated when |
| Copy a working query | Common queries |
| Enforce a rule on every build | Turning a query into a check |
Which route? Use dbt show unless you have a reason not to. It always reads the metadata from the latest dbt command, and it needs nothing installed. Switch to DuckDB when it is installed and you will run many queries, because each dbt show call costs about 0.6 s versus about 0.1 s for DuckDB. The trade-off is that you must refresh the parquet files yourself.