Git Product home page Git Product logo

dbt-starter's Introduction

Gives you a quick local starting point for this free on demand tutorial. https://courses.getdbt.com/collections

Documentation for DBT https://docs.getdbt.com/

Install DBT

python -m venv venv
source venv/bin/activate
pip install -r requirements.txt

Getting Started

Copy postgres profile from ./profiles.yml into your ~/.dbt/profile.yml

Start-up the postgres container db we're going to use (requires docker):

docker compose up

Note this will automatically execute the scripts that sets up the landing tables and source data. The data is loaded from the tutorial csv's here ./data

./data/db-init-scripts

Run DBT:

cd jaffle_shop
dbt run

you should see something like this:

Running with dbt=0.19.1
Found 3 models, 0 tests, 0 snapshots, 0 analyses, 138 macros, 0 operations, 0 seed files, 0 sources, 0 exposures

00:44:19 | Concurrency: 4 threads (target='dev')
00:44:19 | 
00:44:19 | 1 of 3 START view model dw.stg_customers............................. [RUN]
00:44:19 | 2 of 3 START view model dw.stg_orders................................ [RUN]
00:44:20 | 1 of 3 OK created view model dw.stg_customers........................ [CREATE VIEW in 0.13s]
00:44:20 | 2 of 3 OK created view model dw.stg_orders........................... [CREATE VIEW in 0.13s]
00:44:20 | 3 of 3 START view model dw.dim_customers............................. [RUN]
00:44:20 | 3 of 3 OK created view model dw.dim_customers........................ [CREATE VIEW in 0.07s]
00:44:20 | 
00:44:20 | Finished running 3 view models in 0.40s.

Completed successfully

Done. PASS=3 WARN=0 ERROR=0 SKIP=0 TOTAL=3

After successfully running DBT you should be connect to postgres:

username: jaffle_shop
password: jaffle_shop
database: jaffle_shop
server: localhost
port: 5432

DBT will have created 2 staging views used to comprise dim_customers in the schema dw:

dw.stg_customers
dw.stg_orders
dw.dim_customers

Run the the following to view dim_customer

SELECT * FROM dw.dim_customers

Proceed with the tutorial to see how to create and load tables, run tests and much more.

Tear Down

docker compose down

Reset the DB

docker compose down
rm -r ./data/postgres/*

dbt-starter's People

Contributors

shaunryan avatar

Stargazers

Georvic Tur avatar Kristoffer Absalonsen avatar Nicolás Gonik avatar

Watchers

James Cloos avatar  avatar

Forkers

chasets

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.