Prompt
How do I integrate a warehouse with dbt and Looker?
Latest observation
A good way to integrate a warehouse with dbt and Looker is to use the warehouse as the single source of truth, dbt to model and document the data, and Looker to consume those curated models for analytics.
Typical architecture
Source systems → Warehouse → dbt models → Looker
- Warehouse: Snowflake, BigQuery, Redshift, Databricks SQL, etc.
- dbt: transforms raw warehouse tables into clean, tested, documented analytics models
- Looker: builds semantic definitions and dashboards on top of dbt models
Step-by-step integration
1) Load data into your warehouse
First, get raw data from operational systems into the warehouse using ETL/ELT tools such as:
- Fivetran
- Airbyte
- Stitch
- custom pipelines / CDC
Store these in raw schemas like:
rawstagingbronze
2) Set up dbt to connect to the warehouse
Install dbt and the adapter for your warehouse, for example:
dbt-snowflakedbt-bigquerydbt-redshiftdbt-databricks
Create a profiles.yml pointing dbt to your warehouse credentials.
Example conceptually:
my_project:
target: dev
outputs:
dev:
type: snowflake
account: xyz
user: my_user
password: my_password
role: analytics
database: analytics_db
warehouse: compute_wh
schema: dbt_dev
Then test connection:
dbt debug
3) Build dbt models
Use dbt to create:
- staging models: clean and standardize source data
- intermediate models: business logic and joins
- marts / warehouse-ready tables: facts and dimensions for BI
Example:
-- models/marts/fct_orders.sql
select
order_id,
customer_id,
order_date,
total_amount
from {{ ref('stg_orders') }}
Add:
- tests (
unique,not_null, relationships) - documentation (
schema.yml) - materializations (
view,table,incremental)
Run:
dbt run
dbt test
dbt docs generate
4) Expose dbt models to Looker
Looker connects directly to the warehouse, not to dbt itself. So your dbt models should be created in a schema Looker can query.
You have two common patterns:
Pattern A: Looker on top of dbt tables/views
- dbt builds curated tables/views in the warehouse
- Looker connects to those objects
- simplest and most common
Pattern B: Use dbt metadata to generate LookML
- use dbt docs / manifest to help generate LookML
- tools like dbt-to-lookml or Looker’s dbt integration can reduce manual modeling
5) Model in Looker
In Looker:
- define a connection to the warehouse
- create LookML models/views based on dbt outputs
- define dimensions, measures, explores, joins, and access controls
If your dbt marts are already clean and well-modeled, Looker logic stays relatively thin.
Example:
explore: orders {
from: fct_orders
}
Recommended best practices
Keep responsibilities clear
- dbt: transformation, testing, documentation
- Looker: semantic layer, exploration, dashboards, access control
- warehouse: storage and compute
Use dbt for curated layers
A common layer structure:
raworbronzestagingintermediatemart
Keep Looker on stable models
Expose mostly:
- final fact tables
- dimension tables
- aggregate tables where needed
Avoid pointing Looker at raw tables directly unless necessary.
Version control everything
- dbt project in Git
- LookML in Git
- CI/CD for both if possible
Add data quality checks
Use dbt tests to ensure:
- primary keys are unique
- foreign keys resolve
- important fields are not null
- metrics reconcile
Align naming conventions
Make dbt model names and Looker objects predictable:
fct_ordersdim_customersstg_*
Operational workflow
A common daily workflow looks like this:
- Source data lands in warehouse
- dbt runs transformations and tests
- dbt publishes docs and schema changes
- Looker queries the updated mart tables/views
- Analysts build dashboards and explores
Example implementation pattern
If you’re using Snowflake + dbt + Looker:
- Raw data lands in
RAW_DB.RAW_SCHEMA - dbt creates:
ANALYTICS_DB.STAGING.*ANALYTICS_DB.MARTS.*
- Looker connects to
ANALYTICS_DB - Looker explores are built on
MARTStables/views
When to use dbt vs Looker logic
Use dbt for:
- joins
- cleaning
- standardization
- reusable business logic
- metric calculations that should be shared
Use Looker for:
- presentation-layer fields
- user-facing labels
- dashboard-specific calculations
- access filters
- exploratory analysis
If you want dbt and Looker to work especially well together
Look into:
- Looker + dbt integration
- dbt docs artifacts (
manifest.json,catalog.json) - Looker Semantic Layer or metric modeling strategies
- dbt packages for dimensional modeling and testing
If you want, I can also give you:
- a reference architecture diagram,
- a sample dbt project structure for Looker, or
- a step-by-step setup for Snowflake/BigQuery/Redshift.