quoting:database: true | falseschema: true | falseidentifier: true | false
Optionally configure whether dbt should quote databases, schemas, and identifiers when:
- creating relations (tables/views)
- resolving a
reffunction to a direct relation reference
Note that for BigQuery quoting configuration,
schema should be used here, though these configs will apply to
dataset names respectively
The default values vary by database.
For most adapters, quoting is set to
true by default.
This is because creating relations with quoted identifiers does not inhibit the ability to select from them, and quoting allows you to use reserved words as object names (though that should probably be avoided)
quoting:database: trueschema: trueidentifier: true
Set quoting to
false for a project:
quoting:database: falseschema: falseidentifier: false
dbt will then create relations without quotes:
create table analytics.dbt_alice.dim_customers
Set all quoting configs to
False. This means that you cannot use reserved words as identifiers, however it's usually a good idea to avoid these reserved words anyway.
Whereas most databases will lowercase unquoted identifiers, Snowflake will uppercase unquoted identifiers. If a model name is lowercased and quoted, then it cannot be referred to without quotes! Check out the example below for more information.
/*You can run the following queries against your databaseto build an intuition for how quoting works on Snowflake.*/-- This is the output of an example `orders.sql` model with quoting enabledcreate table "analytics"."orders" as (select 1 as id);/*These queries WILL NOT work! Since the table above was created with quotes,Snowflake created the orders table with a lowercase schema and identifier.Since unquoted identifiers are automatically uppercased, both of thefollowing queries are equivalent, and neither will work correctly.*/select * from analytics.orders;select * from ANALYTICS.ORDERS;/*To query this table, you'll need to quote the schema and table. Thisquery should indeed complete without error.*/select * from "analytics"."orders";/*To avoid this quoting madness, you can disable quoting for schemasand identifiers in your dbt_project.yml file. This means that youwon't be able to use reserved words as model names, but you probablyshouldn't be doing that anyway! Assuming schema and identifier quoting isdisabled, the following query would indeed work:*/select * from analytics.orders;
Leave the default values for your warehouse.