quoting
models/<filename>.yml
version: 2sources:- name: jaffle_shopquoting:database: true | falseschema: true | falseidentifier: true | falsetables:- name: ordersquoting:database: true | falseschema: true | falseidentifier: true | false
Definition
Optionally configure whether dbt should quote databases, schemas, and identifiers when resolving a {{ source() }}
function to a direct relation reference.
This config can be specified for all tables in a source, or for a specific source table. Quoting configs defined for a specific source table override the quoting configs specified for the top-level source.
BigQuery Terminology
Note that for BigQuery quoting configuration, database
and schema
should be used here, though these configs will apply to project
and dataset
names respectively
Default
By default, dbt will not quote the database, schema, or identifier.
Example
models/<filename>.yml
version: 2sources:- name: jaffle_shopdatabase: rawquoting:database: trueschema: trueidentifier: truetables:- name: orders- name: customers# This overrides the `jaffle_shop` quoting configquoting:identifier: false
In a downstream model:
models/<filename>.yml
select...-- this should be quotedfrom {{ source('jaffle_shop', 'orders') }}-- here, the identifier should be unquotedleft join {{ source('jaffle_shop', 'customers') }} using (order_id)
This will get compiled to:
select...-- this should be quotedfrom "raw"."jaffle_shop"."orders"-- here, the identifier should be unquotedleft join "raw"."jaffle_shop".customers using (order_id)