First project setup for DBT


First project setup for DBT

Step 1: Install dbt Step 2:

 

(dbt-env) (base) narenderpaul@Narenders-MBP customers % dbt init
12:34:17  Running with dbt=1.7.1
12:34:17  [ConfigFolderDirectory]: Unable to parse dict {'dir': PosixPath('/Users/narenderpaul/.dbt')}
12:34:17  Creating dbt configuration folder at 
Enter a name for your project (letters, digits, underscore): dbtcustomers
12:34:56  
Your new dbt project "dbtcustomers" was created!

For more information on how to configure the profiles.yml file,
please consult the dbt documentation here:

  https://docs.getdbt.com/docs/configure-your-profile

One more thing:

Need help? Don't hesitate to reach out to us via GitHub issues or on Slack:

  https://community.getdbt.com/

Happy modeling!

12:34:56  Setting up your profile.
12:34:56  Encountered an error:
Runtime Error
  No adapters available. Learn how to install an adapter by going to https://docs.getdbt.com/docs/connect-adapters#install-using-the-cli

 

Default  dbt project

 

Step 3 : Step profiles.yml file /Users/narenderpaul/.dbt profiles.yml

 
 
 
 
 

dbtcustomers:
  target: dev
  outputs:
    dev:
      type: mysql
      host: localhost
      user: root
      password: root@123
      port: 3306
      dbname: customers
      schema: dbtcustomers
      threads: 4

Step 4:

 

(dbt-env) (base) narenderpaul@Narenders-MBP dbtcustomers % dbt run              
13:05:33  Running with dbt=1.1.5
13:05:33  Partial parse save file not found. Starting full parse.
13:05:33  Found 2 models, 4 tests, 0 snapshots, 0 analyses, 172 macros, 0 operations, 0 seed files, 0 sources, 0 exposures, 0 metrics
13:05:33  
13:05:33  Concurrency: 4 threads (target='dev')
13:05:33  
13:05:33  1 of 2 START table model dbtcustomers.my_first_dbt_model ....................... [RUN]
13:05:33  1 of 2 OK created table model dbtcustomers.my_first_dbt_model .................. [SUCCESS 2 in 0.08s]
13:05:33  2 of 2 START view model dbtcustomers.my_second_dbt_model ....................... [RUN]
13:05:33  2 of 2 OK created view model dbtcustomers.my_second_dbt_model .................. [SUCCESS 0 in 0.03s]
13:05:33  
13:05:33  Finished running 1 table model, 1 view model in 0.23s.
13:05:33  
13:05:33  Completed successfully
13:05:33  
13:05:33  Done. PASS=2 WARN=0 ERROR=0 SKIP=0 TOTAL=2

 

dbt mysql project