Socket
Book a DemoInstallSign in
Socket

db-clone

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

db-clone

2.2.0
bundlerRubygems
Version published
Maintainers
1
Created
Source

Gem Version Build Status Coverage Status

db-clone

The db-clone gem provides a rake task for cloning one database into another. It does this by making a system call to mysqldump or pg_dump (currently only mysql and postgresql are supported) and uses the contents of your application's database.yml to determine the command line arguments.

Screenshot

Screenshot

Requirements

Ruby >= 2.3

db-clone requires mysqldump (for MySQL) and/or pg_dump (for PostgreSQL).

Installation

Add gem 'db-clone', '~> 2.1' to your Gemfile and bundle install.

Usage

To clone your production database to development, run:

rake db:clone

If you have more database blocks (besides production and development) defined in config/database.yml, you can clone between these databases using DbClone's CLI:

rake db:clone[manual]

Configuration

By default rake db:clone will read from config/database.yml and use your production database as the source and development as the destination. You can configure these defaults to something else by adding to your Rakefile (or in an initializer if you're using Rails):

Db::Clone.setup do |config|
  # default is 'config/database.yml'
  config.database_yml_path = '/path/to/my_database_config.yml'

  # default is 'production'
  config.default_source_database = 'my_source_db'

  # default is 'development'
  config.default_destination_database = 'my_destination_db'

  # default is [], adds --ignore-table arguments to mysqldump or --exclude-table arguments to pg_dump
  config.ignore_tables = ['schema_migrations', 'some_other_table']
end

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/seanhuber/db-clone.

License

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

FAQs

Package last updated on 16 Nov 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.