dbt project metadata queries
Answers questions about a dbt project's models, tests, lineage and run times from its information schema.
Claude's review
8/10 Precise guide to querying the dbt information schema with routing rules, column gotchas and ready queries.
We asked Claude the question you would ask: would I be glad I installed this? Two separate reviews, the second blind to the first, must both rate a skill 7 or higher before we sell it.
In detail
Use when answering questions about a dbt v2 project's own metadata — which models, sources, tests, columns, configs, tags, packages or lineage exist, what is untested or undocumented, what depends on what, how long models took in the last run — or when using `dbt show --info`, `{{ info_schema() }}`, `--generate-info-schema`, `target/info_schema/`, or writing `dbt check` SQL. Prefer this over grepping YAML or parsing `manifest.json` on dbt v2.
How you use it
- Add it to your pack, then download your pack (1 credit).
- In Claude, open Customize > Skills and upload the zip. Code execution needs to be on under Settings > Capabilities.
- Ask Claude for the job in your own words. It uses the skill when your request matches what it does. Step by step guide
Safety check
Nothing risky found: no hidden instructions, no download and run, no reading of saved passwords or keys.
An automated scan lowers risk but cannot promise zero risk. How we check skills
Preview
The first lines of SKILL.md
---
name: querying-the-dbt-information-schema
description: Use when answering questions about a dbt v2 project's own metadata — which models, sources, tests, columns, configs, tags, packages or lineage exist, what is untested or undocumented, what depends on what, how long models took in the last run — or when using `dbt show --info`, `{{ info_schema() }}`, `--generate-info-schema`, `target/info_schema/`, or writing `dbt check` SQL. Prefer this over grepping YAML or parsing `manifest.json` on dbt v2.
user-invocable: false
metadata:
author: dbt-labs
---
# 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](#prerequisites) |
| Answer a one-off question | [Route A: `dbt show`](#route-a-dbt-show-default) (default) |
| Run many queries, script them, or use `run_results_latest` | [Route B: DuckDB on the parquet files](#route-b-duckdb-on-the-parquet-files) |
| Avoid wrong answers from tricky columns | [Column gotchas](#column-gotchas) |
| Understand why a view is empty | [What is populated when](#what-is-populated-when) |
| Copy a working query | [Common queries](#common-queries) |
| Enforce a rule on every build | [Turning a query into a check](#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.
| | Route A: `dbt show` | Route B: DuckDB on parquet |
|---|---|---|
| Table names | `{{ info_schema('models') }}` (Jinja, bare view name) | `dbt.models`, `dbt_rt.run_results` (after `.read views.sql`), or `'dbt.models.parquet'` |
| Freshness | Updated by `build`, `run`, `check` by default | Updated only by a command run with `--generate-info-schema` |
| Needs | dbt v2 | dbt v2 once, plus the `duckdb` CLI or a parquet library |
| `dbt_rt.run_results_latest` | Not available | Available |
| Speed per query | ~0.2–0.7 s | ~0.1 s |
## Prerequisites
- **dbt v2 only.** Run `dbt --version` first. The docs mark this feature "Available in v2". On dbt Core 1.x, fall back to `manifest.json`.
- **Project metadata must exist.** `dbt build`, `dbt run`, and `dbt check` write it by default. `dbt parse` and `dbt compile` write it with `--generate-info-schema`. If none of these has run, `dbt show --info` fails with `InfoSchemaUnavailable` (dbt1656) and names a command to run.
...From dbt-labs's repository, Apache-2.0 licence.
Related skills
-
Checked
dbt platform migration
Moves a dbt project from one warehouse to another and fixes SQL dialect gaps, so your models build again.
7/101 credit -
Checked
CSV and Excel merging
Merges, stacks and dedupes CSV and Excel files into one clean table, then checks the row counts add up.
7/101 credit -
Checked
dbt Mesh contracts
Checks whether a dbt model change breaks consumers and versions it, so downstream dashboards keep working.
7/101 credit -
Checked
SQL and dbt Analytics
Writes analytical SQL and dbt models tested for grain and join errors, so the numbers come out right.
7/101 credit -
Checked
D3 Animated Data Charts
Turns sourced data into honest, accessible animated D3 charts that render reliably frame by frame for video.
7/101 credit -
Checked
Graph Analytics in Snowflake
Runs Neo4j graph algorithms like PageRank and Louvain on your Snowflake tables without moving data.
7/101 credit