This directory contains files to start a database locally with all the data from the jaffle shop project. This is helpful for testing, or just playing with the data contained in this dbt project.
How it works
Docker compose is used to run multiple related services together. In this case, we're running two services:
postgres
: this is our database, we can connect to it to query the data using sqldbt
: this is a service that runs dbt-core and converts this jaffle-shop project into useful data in postgres
- Not planning on making any changes to the data models in the Jaffle Shop demo? Check out option 1.
- Planning to make some changes to the data models in the Jaffle Shop demo? Check out option 2.
Open up your favourite terminal and clone this repo
git clone git@github.com:lightdash/jaffle_shop
cd jaffle_shop/docker
Fork the Jaffle Shop repo by clicking the fork
button on the top right of the GitHub screen.
Open up your favourite terminal and clone your new repo
git clone git@github.com:your_profile_name/jaffle_shop # replace your_profile_name with the correct value
cd jaffle_shop/docker
You need to install docker
Run the script:
./start.sh
This will start a postgres database and then run dbt to fill it with Jaffle Shop data!
The first time you run this command it might take a long time to download the docker images needed.
You can manually connect to the postgres database to check it has the data in
./connect.sh
You'll now be in a postgres console, try the following sql command:
select * from jaffle.payments;
If you don't see any data, something went wrong
To exit type Ctrl-d
(that's the control key and d
together)
You can use the following info to connect any tools to your postgres database:
port: 5432
host: localhost ( or 'host.docker.internal' if accessing from another docker container )
user: postgres
password: password
database: postgres
schema: jaffle
ssl: false ( or 'disabled' )
Battery running low on your laptop? Stop all the services and stop wasting power
./stop.sh