target db/schema and profile is hidden or uncomprehending

The problem I’m having can be explained by the attached screenshots. The profile in the dbt_project.yml is default. While there is a macro that decides which DB and schema is chosen for building the objects in. The problem is where is this macro(get_custom_database) registered to be executed when I build or run my .sql. Simply what is the execution lifecycle of dbt cloud. Lastly when we run dbt projects in snowflake, does the execution and code get executed in dbt or snowflake first?

The context for this is to find out if I stop developing in dbt cloud and do development in snowflake do i need dbt account.

I’ve not tried to change anything since the same things are in deployment in both prod and dev environemnts.

Some example code or error messages

Put code inside backticks
  to preserve indentation
    which is especially important 
      for Python and YAML!