In dbt Cloud, the default database and schema values are typically configured in the dbt_project.yml
file and the profiles.yml
file (or through the dbt Cloud UI if you're using managed connections)
1. dbt_project.yml – Defines the schema naming convention
**In your dbt_project.yml, you can set the default schema using the schema configuration:
name: my_project
version: '1.0'
config-version: 2
profile: my_profile
# Optional: override default schema
models:
my_project:
+schema: analytics
This sets the default schema for models in the project.
2. profiles.yml – Defines the database connection
**This file is used locally or configured via the dbt Cloud UI. It defines the target database and credentials:
my_profile:
my_profile:
target: dev
outputs:
dev:
type: snowflake
account: your_account
user: your_user
password: your_password
role: your_role
database: your_database
warehouse: your_warehouse
schema: your_schema
FYI In dbt Cloud, this is usually configured through the "Environment" settings under "Deploy" > "Environments", where you define:
Target database
Default schema
Warehouse (for Snowflake)
regards, your question - why does dbt want to prefix the default schema value to what I originally specified in my config statement?
dbt's behavior of prefixing the default schema value (from your target profile) to what you specify in your model config is part of its schema naming convention strategy, and it’s designed to support multi-environment development and namespacing.