Code Monkey home page Code Monkey logo

dbt_intro's Introduction

Welcome to your new dbt project

This tutorial makes use of Visual Studio Code (VSC) as the IDE, Snowflakes as the data warehouse.

I will attempt to be very detailed in my explanations as to using dbt with Snowflakes

Creating a snowflakes account

As a new user: simply navigate to the snowflakes sign up page and get started with the 30-days free trial (you can do an actual subscription if you can afford one). Proceed to fill in your details, and an activation mail will be sent to your email. click on the activation link and chose a user name, your preferred cloud provider (Google Cloud, Microsoft Azure, or Amazon Web Services). Thereafter, you can proceed to the login page. (You will want to bookmark this page for easy accessibility)

Now take note of your username, account_link (something like this: mf......us-central1.gcp) this assumes that I am using gcp as my cloud provider, and my data center is in us-central.

Click on the icon where your username is captured, select switch role (account admin is what is used in this tutorial, you might want to try something else).

You also need want to check for the following:

  • warehouse name
  • Database name
  • Schema

Initializing dbt Project

To get started:

  • Install the dbt module on your computer using "pip command": "pip install dbt". You can verify the information about your current installed version using "pip show dbt" command.
  • Create an empty folder/directory on your computer.
  • Create a new repository on your github account do not select the .gitignore, README.md and LICENSE options (optional, but a good practice).
  • Copy the link to the repository you have just created.
  • From your IDE (VSC), navigate to the folder you created in step 1, and clone the repository into the new directory created using the "git clone" command.
  • Initialize your dbt project using the "dbt init" command. Here, you will need to give your project a name. The command for this is: "dbt init [project_name]"
  • Once you are done doing this, if you navigate to your home directory (for windows users: C:/Users/account_name; for linux users: /home/account_name), you notice that a new folder/directory (.dbt) has been created there (you may have to enable the show hidden files option on your computer to be able to view this folder). There are two files in this directory; profiles.yml and users.yml.
  • Now open the profiles.yml file with your editor, and update the content with appropriate details. A sample template (profiles.ym) is attached in this repository.

You will notice from the initialized project that new files and directories are being added to your current directory.

After updating the profiles.yml file, navigate back to the dbt_project.yml file and change the model name to name of your initialized model. Thereafter, proceed to towards the end of the page, and update the model name to match with the earlier stated name.

Using the starter project

Try running the following commands:

  • dbt debug (if this run successfully, then you are ready to start exploring dbt leveraging the full power of snowflakes)
  • dbt seed (to upload the attached csv file in Data folder to your snowflake warehouse)
  • dbt run
  • dbt test

Resources

  • Learn more about dbt in the docs
  • Check out Discourse for commonly asked questions and answers
  • Join the chat on Slack for live discussions and support
  • Find dbt events near you
  • Check out the blog for the latest news on dbt's development and best practices.
  • Learn more about snowflakes in the docs

Author: Muhammad Abiodun Sulaiman

Email: [email protected] or [email protected]

LinkedIn: Muhammad Abiodun Sulaiman

Twitter: @Prince_Analyst

Facebook: Muhammad Abiodun Sulaiman

Tel: +2348108316393

My Pix.png

dbt_intro's People

Contributors

behordeun avatar

Stargazers

 avatar

Watchers

 avatar  avatar

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.