Seed configurations

Available configurations

Seed-specific configurations

dbt_project.yml
seeds:
+quote_columns: true | false
+column_types: {column_name: datatype}

General configurations

dbt_project.yml
seeds:
+enabled: true | false
+schema: string
+database: string
+alias: string
+pre-hook: sql-statement | [sql-statement]
+post-hook: sql-statement | [sql-statement]
+tags: string | [string]
+persist_docs: {<dict>}
+full_refresh: <boolean>

Configuring seeds

Seeds can only be configured from the dbt_project.yml file, under the seeds: key. To apply a configuration to a seed, or directory of seeds, define the resource path as nested dictionary keys.

Seed configurations, like model configurations, are applied hierarchically — configurations applied to a marketing subdirectory will take precedence over configurations applied to the entire jaffle_shop project.

Examples

Apply the schema configuration to all seeds

To apply a configuration to all seeds, including those in any installed packages, nest the configuration directly under the seeds key:

dbt_project.yml
seeds:
+schema: seed_data

Apply the schema configuration to all seeds in your project

To apply a configuration to all seeds in your project only (i.e. excluding any seeds in installed packages), provide your project name as part of the resource path.

For a project named jaffle_shop:

dbt_project.yml
seeds:
jaffle_shop:
+schema: seed_data

Similarly, you can use the name of an installed package to configure seeds in that package.

Apply the schema configuration to one seed only

To apply a configuration to one seed only, provide the full resource path (including the project name, and subdirectories).

For a project named jaffle_shop, with a seed file at data/marketing/utm_parameters.csv, this would look like:

dbt_project.yml
seeds:
jaffle_shop:
marketing:
utm_parameters:
+schema: seed_data

Example seed configuration

The following is a valid seed configuration for a project with:

  • name: jaffle_shop
  • A seed file at data/country_codes.csv, and
  • A seed file at data/marketing/utm_parameters.csv
dbt_project.yml
name: jaffle_shop
...
seeds:
jaffle_shop:
+enabled: true
+schema: seed_data
# This configures data/country_codes.csv
country_codes:
# Override column types
+column_types:
country_code: varchar(2)
country_name: varchar(32)
marketing:
+schema: marketing # this will take precedence