kenn/dumper — pull request #5 by justinlocsei (2014-08-29 03:42:17+00:00)
Title: Allow PostgreSQL to create custom-format dumps

We've had more luck restoring from PostgreSQL's custom dump format than its SQL one, and we wanted to be able to create these dumps in Dumper. To make this happen, I updated the agent to accept a `:dumper_options` option that is a hash of database symbols whose keys should match the `DATABASES` constant in `Dumper::Stack` and whose values should be hashes of options that each database type is free to interpret. For the moment, I added a single option to the PostgreSQL database that allows the dump format to be customized via the `:format` key, which defaults to `:sql` for creating SQL dumps (preserving the previous behavior), but can be set to `:custom`, which will create a custom-format dump.

As an example, this is how we're using it in our Dumper initializer:

```ruby
Dumper::Agent.start(
:app_key => ENV['DUMPER_KEY'],
:dumper_options => {
:postgresql => {
:format => :custom
}
}
)
```

I've tried this out in production, and it seems like Dumper.io handles this change just fine, so I figured I'd share this in case it's useful to others.