The problem I’m having
I am fully new to dbt
When I try to run “dbt debug” I have this error : Runtime Error
The profile ‘dev’ does not have a target named ‘dev’. The valid target names for this profile are:
- source
- bloc_dimensions
- set_dimensions
- calculations
See the code of profiles.yml and dbt_project.yml
I explain the context in the next section.
The context of why I’m trying to do this
I have a local postgres server with 3 databases. A source database containing the raw data, another database to store materialized dimension models and another databse that stores others materialized dimensions models.
I want to use the source database to calculate the materialized dimension models and store those tables in a specific database (bloc_dimensions/set_dimensions) of the postgres server. I don’t know if it is a good practice or not.
What I’ve already tried
I tried to setup differents outputs (see the code) on the same profile but I have an error and I don’t really understand why.
Some example code or error messages
profiles.yml
dev:
  target: dev
  outputs:
    source:
      type: postgres
      host: localhost
      user: postgres
      pass: Tictact0c!
      port: 5432
      dbname: ebay_sales_db
      schema: public
      threads: 4
    bloc_dimensions:
      type: postgres
      host: localhost
      user: postgres
      pass: Tictact0c!
      port: 5432
      dbname: bloc_db
      threads: 4
    set_dimensions:
      type: postgres
      host: localhost
      user: postgres
      pass: Tictact0c!
      port: 5432
      dbname: set_db
    calculations:
      type: duckdb
      path: /path/to/your/duckdb/database
prod:
  target: prod
  outputs:
    prod:
      type: postgres
      host: localhost
      user: postgres
      pass: Tictact0c!
      port: 5432
      dbname: ebay_sales_db
      schema: public
      threads: 4
    bloc_dimensions:
      type: postgres
      host: localhost
      user: postgres
      pass: Tictact0c!
      port: 5432
      dbname: bloc_db
      threads: 4
    set_dimensions:
      type: postgres
      host: localhost
      user: postgres
      pass: Tictact0c!
      port: 5432
      dbname: set_db
    calculations:
      type: duckdb
      path: /path/to/your/duckdb/database
dbt_project.yml
name: "dbt_poke_price_tracker"
version: "1.0.0"
profile: "dev"
model-paths: ["models"]
analysis-paths: ["analyses"]
test-paths: ["tests"]
seed-paths: ["seeds"]
macro-paths: ["macros"]
snapshot-paths: ["snapshots"]
clean-targets: # directories to be removed by `dbt clean`
  - "target"
  - "dbt_packages"
models:
  dbt_poke_price_tracker:
    staging:
      materialized: view
      +persisted: true 
    
    bloc_dimensions:
      materialized: table
      +persisted: true
      +database: bloc_dimensions
    set_dimensions:
      materialized: table   
      +persisted: true
      +database: set_dimensions