EvilSeed is your go-to tool for generating partial anonymized dumps from your database model relations. It helps you manage the balance between realism and privacy when working with production-like data in staging environments. With easy configuration and powerful options to customize data inclusion, debugging becomes a smooth process, without the baggage of sensitive information.
EvilSeed is a powerful Ruby gem designed to facilitate the creation of partial anonymized dumps of your database by leveraging your application's model relationships. Ideal for developers seeking to utilize production-like data in staging environments, EvilSeed addresses two significant challenges: the size of production database dumps and concerns regarding sensitive data anonymization.
Key Features
- Streamlined Data Dumping: Combine the convenience of partial data extraction with customizable constraints to effectively limit the records and associations included in your dumps.
- Flexible Configuration: Configure the gem with ease using a simple DSL syntax that allows you to specify root models, exclude or include associations, and customize dumped records.
- Anonymization Support: Safeguard sensitive user information by applying anonymization transformations, ensuring compliance with best practices while debugging.
- Database Compatibility: Works seamlessly with PostgreSQL, MySQL, and SQLite, making it versatile for various development environments.
Getting Started
Easily integrate EvilSeed into your Rails application by adding it to your Gemfile:
gem 'evil-seed', require: false
Then, configure it to define which models and associations to include or exclude when creating a dump:
EvilSeed.configure do |config|
config.root('Forum', featured: true) do |root|
root.exclude(/tracking_pixels/)
root.include(parent: {questions: %i[answers votes]})
root.limit_associations_size(100)
root.limit_deep(10)
end
end
Usage Example
Creating a dump is straightforward. Just call the #dump
method with your desired file path:
EvilSeed.dump('path/to/new_dump.sql')
Caveats and Tips
- Specify roots for dictionaries and system-wide models first, and make use of the
exclude
method to control data flow effectively. - Touch base with the resulting dump to ensure no unwanted data has been included; the comments within can provide helpful insights.
Contributing
We welcome contributions! Please submit bug reports and pull requests on the GitHub repository.
Transform the way you handle database dumps with EvilSeed and empower your development with partial, anonymized data that preserves sensitive information while facilitating in-depth debugging.