New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

veksel

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

veksel

  • 0.3.1
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

Gem Version Build status

Veksel: Database branching for Rails

Veksel keeps seperate databases for every branch in your development environment. This makes it easy to experiment with schema changes and data with less risk and avoid conflicting changes to schema.rb when branches have different sets of migrations. The inspiration for the gem came from branch support in Neon.

Postgresql is currently the only supported database driver.

Usage

Out of the box, Veksel requires explicit invocation to work. Refer to Git hook below if you're interested in a more automated approach.

Checkout a new branch and run bundle exec veksel fork. A new database with a suffix matching your branch name will be created and tmp/restart.txt will be touched so your application servers restart. Both database structure and contents will be copied from your primary development database and Veksel will tell Rails on boot that the forked database should be used.

When moving back to your main branch, run touch tmp/restart.txt to make Rails connect to default development database.

Veksel tasks

The CLI supports the following commands

veksel fork                        Create a forked database
veksel clean                       Delete forked databases
veksel fork                        Fork the database from the main branch
veksel list                        List forked databases

You can also run the commands as rake tasks (e.g. bin/rails veksel:list), albeit with a penalty hit.

Git hook

Add the following to .git/hooks/post-checkout to automatically fork your database when checking out a branch:

#!/bin/sh
bundle exec veksel fork

Installation

Add this line to your application's Gemfile:

gem "veksel", group: :development

And then execute:

$ bundle

Or install it yourself as:

$ gem install veksel

Roadmap

  • Promote a forked database to main
  • Explicit/optional branching
  • Other database drivers

Release process

# Bump version number in lib/veksel/version.rb

# Update lockfile
bundle install

# Update changelog, review manually before committing
conventional-changelog -p conventionalcommits -i CHANGELOG.md -s
git commit -m 'chore(release): x.y.z'
git push origin
git tag vx.y.z
git push origin vx.y.z

# Build and push gem
gem build
gem push veksel-x.y.z.gem

# Upload the veksel-x-y-z.gem file to the Github release page

Sponsors

Veksel is sponsored by Skalar

License

Veksel is licensed under MIT.

FAQs

Package last updated on 02 Dec 2024

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