Jaffle Shop is an example project officially provided by dbt-labs. This document uses jaffle_shop_duckdb to enable you to start using recce locally from scratch within five minutes.
-
Clone the “Jaffle Shop” dbt data project
git clone [email protected]:dbt-labs/jaffle_shop_duckdb.git cd jaffle_shop_duckdb
-
Prepare virtual env
python -m venv venv source venv/bin/activate
-
Installation
pip install -r requirements.txt pip install recce
-
Provide additional environment to compare. Edit
./profiles.yml
to add one more target.jaffle_shop: target: dev outputs: dev: type: duckdb path: 'jaffle_shop.duckdb' threads: 24 + prod: + type: duckdb + path: 'jaffle_shop.duckdb' + schema: prod + threads: 24
-
Prepare production environment
dbt build --target prod dbt docs generate --target prod
and copy the artifacts to
./target-base/
cp -R target/ target-base/
-
Prepare development environment. First, edit an existing model
./models/staging/stg_payments.sql
.... renamed as ( payment_method, - -- `amount` is currently stored in cents, so we convert it to dollars - amount / 100 as amount + amount from source )
run on development environment.
dbt build dbt docs generate
-
Run the recce server
recce server
or the following command if you would like to persist the recce state.
recce server issue-123.json
Open the link http://0.0.0.0:8000, you can see the lineage diff
-
Switch to the Query tab, run this query
select * from {{ ref("orders") }} order by 1
Click the
Run Diff
or pressCmd + Shift + Enter
Click on the 🔑 icon next to the
order_id
column to compare records that are uniquely identified by theirorder_id
. -
Click the
+
to add the query result to checklist