arturcp / postgresql-backup

Automate PostgreSQL's backup and restore
11 stars 10 forks source link

Add support to hooks #6

Closed arturcp closed 1 year ago

arturcp commented 1 year ago

Backup and restore are working fine with the latest ruby versions, but sometimes we need to execute code in certain steps of the process. For example, you may need to send a message somewhere warning about a database restore before it happens, or after a dump is completed. Perhaps you use Elastic Search, Open Search, Algolia or even pg_search plugin, and need to reindex your data after a backup is restored.

The proposal on this pull request is to add hooks capabilities to the gem. By passing a class (or an instance of a class) in the configuration, you can execute custom code in any of these steps:

I am also modifying the documentation accordingly, so people can find information about the hooks on the README of the project.