dbt app example
Get more details in the blog post.
First, install dbt following these installation instructions. For Mac:
brew update brew install git brew tap fishtown-analytics/dbt brew install dbt
This example uses a Postgres database, though it also works with other data warehouses with the necessary SQL updates. Create one called
Next, you will need to teach dbt how to connect to your warehouse.
dbt, this lives in
There is an example file checked into this repo as
profiles.example.yml. Copy it to
~/.dbt/profiles.yml and edit as needed.
Now, let's seed some data. This will create a
users and a
purchases table in your Postgres database:
Now, we install Node.js for Grouparoo to use. This project has an
.nvmrc file, so it will be in a v14
nvm instance if you use that. Otherwise, use Node.js version 12+.
cd grouparoo && npm install
Finally, let's set up the Grouparoo
.env file. These can also be set in the system
cp grouparoo/.env.example grouparoo/.env
You will need to edit the following environment variables to real ones if you want it to sync to Mailchimp:
There is a script that runs both dbt and Grouparoo:
It is relatively simple if you want to do them separately:
dbt run cd grouparoo && npm run sync
This project transforms the seeded
purchases table into a few views:
customersview with roll ups of key properties
sync_mailchimpfor the data we want to sync to Mailchimp
Handles syncing data to destinations, using Postgres as a warehouse.
It syncs customers' emails, first name, and lifetime value from the