yamldb / yaml_db

Rails plugin for a database-independent dump format, data.yml .......... Seeking new maintainers! See https://github.com/yamldb/yaml_db/issues/143
https://rubygems.org/gems/yaml_db
949 stars 200 forks source link

Allow choosing base; also added StdoutBase to allow dumping to STDOUT #40

Open International opened 12 years ago

International commented 12 years ago

I added the possibility of dumping to STDOUT. I also added a Rake task called dump_to_stdout, and two small tests.

Here's why I find this functionality helpful:

I use Heroku for developing, and sometimes I need to do a database dump. The thing is, exporting the database using taps almost never works, so I started looking for an alternative. By allowing the output to be dumped to STDOUT, I can run the following command:

heroku run rake db:data:dump output_base=SerializationHelper::StdoutBase --app myapp > db/data.yml

And, this way, I can write the dump to my own computer. Please have a look, see if you find this helpful/worthy of integrating in your code :)

Best wishes,

George