snapshot_models
Captures historical changes in data using SCD Type 2 snapshots, preserving accurate historical records in data warehouses.
Instructions
Snapshot models (capture historical changes - SCD Type 2).
Snapshots capture historical changes in data, enabling you to track slowly changing dimensions over time. This is particularly useful for maintaining accurate historical records in data warehouses.
When to use: To track changes in slowly changing dimensions (SCD Type 2). For example, tracking customer address changes over time while preserving history.
How it works: dbt compares current source data with existing snapshot table, identifies changes, and inserts new rows with validity timestamps (dbt_valid_from, dbt_valid_to, dbt_updated_at). Original rows are closed by setting dbt_valid_to.
Args: select: dbt selector syntax (e.g., "snapshot_name", "tag:daily") exclude: Exclude specific snapshots state: Shared state object injected by FastMCP
Returns: Snapshot results with status and timing info
Examples: # Run all snapshots snapshot_models()
# Run specific snapshot
snapshot_models(select="customers_snapshot")
# Run tagged snapshots
snapshot_models(select="tag:daily")Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| select | No | ||
| exclude | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||