dbt setup

How to setup dbt core ?

dbt core setup

Here we will explain how to setup DBT core in Dev container, in the other post https://juliovaldiviamarin.com/dev-container-dbt-postgresql-metabase-part-1/ we see how to install DBT in vs code deb container, now inside in the dev container we will setup dbt core like: dbt project name, profile database(hostname, port, username, password,dbname, schema, threads)

dbt init

dbt init is a command to setup a new dbt project, for our example we have to go to the dev container of VS code, in the menu terminal click on New Terminal :

dev container new terminal

inside of the terminal write dbt init

dbt init

type the name of the dbt project : for example dbt_proj

dbt project name

the command create the folder structure on our folder

  • analyses
  • macros
  • models
  • seed
  • snapshots
  • test
dbt folder structure

then we have to choose the database adapter in our case is PostgreSQL

dbt postgres adapter

then we have to put the configuration of the database to connect:

  • hostname
  • port
  • user
  • password
  • dbname
  • schema
  • threads
dbt postgres configuration

Next post we will see how to upload data from csv to postgresql

Links:

https://docs.getdbt.com/reference/commands/init

https://code.visualstudio.com/docs/devcontainers/create-dev-container


Posted

in

, , , ,

by

Comments

Leave a Reply