Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

branchbot

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

branchbot

  • 0.2.1
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

branchbot

Save and restore the state of your Rails development and test databases as you work on different branches.

This allows you to make some changes to the structure of your database on a feature branch, then be able to quickly switch back to your master branch to make a hotfix or start a new feature branch with your original database structure and content.

Installation

  1. Install the gem:

    gem install branchbot

  2. Download the post-checkout file into the .git/hooks directory of your project. Modify to configure any flags.

    Note: Be sure to keep the post-checkout name to match Git's expectations.

Options

  • --app-root - The app root relative to the project root (default: '.')
  • --db-config-erb - Interpret database.yml as ERB an template before parsing as YML (default: disabled)

Support

Only PostgreSQL and MySQL databases are currently supported.

Non-Rails Usage

While this hook is geared towards Rails and depends on Ruby, it is very easy to use it in non-Ruby/Rails projects, so long as you have Ruby installed on your system.

This script will look for a config/database.yml file in your app's root (configurable via --app-root), and expects it to look like this:

development:
  adapter: <adapter>
  username: <database username>
  password: <database password>
  database: <database name>

We currently support two adapters: mysql2 and postgresql. We don't actually rely on these gems, but instead use them to determine which database's command line tools we should use (mysqldump/mysql or pg_dump/psql). Use mysql2 if you are using a MySQL database, or postgresql if you are using a PostgreSQL database.

FAQs

Package last updated on 26 Feb 2023

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

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc