A Rails plugin to dump database records into seed files (db/seeds.rb) for easy data persistence and sharing.
Seed Dump is a Ruby on Rails plugin that exports existing database records into seed data files (like db/seeds.rb). It solves the problem of manually creating or maintaining seed data by automatically generating Rails-compatible seed code from live database content. This is particularly useful for capturing realistic datasets for development, testing, or sharing across team members.
Rails developers who need to populate databases with consistent, realistic data across environments, or teams that want to share specific database states without manual seed file creation.
Developers choose Seed Dump because it automates a tedious manual process, handles complex data relationships (foreign keys, STI, HABTM) correctly, and offers extensive customization through options like limits, exclusions, and multiple output formats for different use cases.
Rails task to dump your data to db/seeds.rb
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Automatically dumps models in foreign key dependency order, ensuring parent records are created before child records to maintain referential integrity, as described in the 'Automatic Behaviors' section.
Supports default create!, insert_all, upsert_all, and activerecord-import formats, allowing optimized data loading for different use cases like idempotent seeds or bulk inserts, detailed in the 'Options' section.
Intelligently manages Single Table Inheritance and has-and-belongs-to-many join tables to avoid duplication, with configurable options like group_sti_by_class for subclass-specific attributes, ensuring accurate seed generation.
Enables dumping specific models, filtered records with limits, and attribute exclusions, providing precise data extraction capabilities as shown in the rake task and console examples.
The default batch_size of 1000 can lead to out-of-memory errors with large datasets, requiring manual tuning and potential performance trade-offs, as cautioned in the batch_size option description.
Primarily designed for Rails; using it outside Rails requires a custom Rake task setup, which adds complexity and may not fully support all features like automatic dependency ordering.
With numerous options such as model_limits, exclude, and import formats, setting up optimal dumps can be cumbersome for simple use cases or developers unfamiliar with the tool's intricacies.