Can you automate the dbt_project.yml

The problem I’m having

In snowflake we have the same DB’s but they have prod or dev at the end. Can we automate thedbt_project.yml so that it would automatically set it for dev or prod. So we dont have to change it manually.

The context of why I’m trying to do this

What I’ve already tried

This is what we do now.
[database: mde_bi_dev #switch to mde_bi_dev during development, mde_bi_prod before creating PR]

create an environment variable , if the environment is prod then initialize with prod else dev

then use like this in ur dbt_peoject.yml where ever you are referring database
database: mde_bi_{{ env_var('environment_var_name') }}