Skip to main content
Seeds are CSV files under seeds/ that SQLBuild loads as tables in the warehouse. They’re useful for small, static reference data like lookup tables, category mappings, or configuration values.

Defining a seed

Place a CSV file in your seeds/ directory:
Declare the seed’s column types in any .yml file under seeds/. You can use any filename and organize declarations however you like - one file per seed, or group related seeds together:
Every seed must have a YAML declaration with at least one typed column. CSV filenames must be unique across the entire seeds/ directory (including subdirectories). The seed name in the YAML must match the CSV filename (without the .csv extension).

Referencing seeds

Seeds are referenced in models with __seed():
__seed() is distinct from __ref(). Using __ref() with a seed name raises a compile error with a message pointing you to __seed().

Loading seeds

Seeds are loaded automatically during sqb build. You can also load them standalone:
Seeds are fully replaced on every run. If the CSV changes, the table is recreated with the new data.

Target overrides

Seeds inherit the project’s default database and schema. You can override these per seed:

CSV settings

For non-standard CSV formats, configure parsing behavior with csv_settings:

Available CSV settings

Per-column NA values

na_values can be a flat list (applied to all columns) or a mapping from column names to their NA values: