Skip to content

npezza93/sqlite_backups

Repository files navigation

SQLiteBackups

A dead simple Rails engine to backup your SQLite databases utilizing Active Storage.

Usage

To backup a database:

$ bin/rails backup:[database_name]

Alternatively, you can use a job:

Backups::DatabaseJob.perform_later(database_name)
Backups::AllJob.perform_later

To restore a database:

$ bin/rails restore:[database_name]

Installation

Add this line to your Gemfile:

gem "sqlite_backups"

And then execute:

$ bundle

Then run the installer to copy over the migration and mount a route we use for restoring:

$ bin/rails backups:install

These are the available configuration options:

config.backups.storage_service = :backups
config.backups.retention = 1.day

The storage_service value points to a defined ActiveStorage service.

License

The gem is available as open source under the terms of the MIT License.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors