What Are Seeds?
Seeds are CSV files stored in your dbt project’sseeds/ directory that dbt loads into your data warehouse. They become part of your version-controlled project and are accessible in models via the ref() function, just like any other model.
Seeds work best for data that changes infrequently, is relatively small in size, benefits from version control, and doesn’t require complex transformations before use.
Common Use Cases for Seeds
Reference and Mapping Tables
Seeds are ideal for relatively static reference data such as country codes, currency conversion rates, product categorizations, department hierarchies, and calendar dimensions like fiscal years or holidays.Configuration Tables
Use seeds as configuration tables for your transformations, including parameter tables, inclusion/exclusion lists, feature toggles, metric definitions, and valid value lists.Test Data
Seeds provide a convenient way to manage test datasets, including sample customer profiles, test transactions, and expected results for complex calculations.Creating and Using Seeds
Adding a Seed to Your Project
To add a seed to your project:- Create a CSV file with headers in the first row
- Save it in your project’s
seeds/directory - Ensure the file uses proper CSV formatting (commas as delimiters, proper escaping)
seeds/country_codes.csv:
Loading Seeds into Your Warehouse
Run the seed command to load all seeds into your data warehouse:Referencing Seeds in Models
Reference seeds in your models using theref() function, just like you would with models:
Configuring Seeds
Basic Configuration
Configure seeds in yourdbt_project.yml file:
Advanced Configuration Options
Best Practices for Using Seeds
When to Use Seeds (and When Not To)
Performance Considerations
Keep seeds small to avoid version control and build time issues. Use appropriate column types to optimize storage and be mindful of dependencies on seeds throughout your project. For larger datasets or frequently changing data, consider alternatives to seeds.Seed File Size LimitsWhile there’s no hard limit on seed file size, large CSV files (>1MB) can cause performance issues and version control challenges. For larger datasets, consider using external data loading tools, creating a source table instead, or splitting the data into multiple smaller seed files.
Maintenance Strategies
Document the purpose of each seed and establish clear ownership for seed maintenance. Create processes for updating seeds and consider automation for seeds that change more frequently but still warrant being included in your project.Seeds in Paradime
Paradime enhances the seed experience with visual CSV editing, data previews, version history tracking, and simplified update workflows.Rainbow CSV Integration
Paradime integrates Rainbow CSV, which makes seed file management more efficient through:- Color-coded columns for easier reading
- Visual alignment of CSV data
- Multi-cursor column editing
- Automatic CSV format validation
For more details, see our Rainbow CSV documentation.