{"repo":"milkstrawai/branch_db","free":true,"listed":false,"github":"https://github.com/milkstrawai/branch_db","clone":"git clone https://github.com/milkstrawai/branch_db.git","description":"Automatic per-branch PostgreSQL databases for Rails development","language":"Ruby","stars":23,"topics":["database","development","git-branches","postgresql","ruby-on-rails"],"license":"MIT","category":"databases-storage","readme_excerpt":"BranchDb Automatic per-branch PostgreSQL databases for Rails development. BranchDb eliminates database migration conflicts by giving each git branch its own isolated database. Switch branches freely without worrying about schema mismatches or losing development data. Table of Contents - The Problem - The Solution - Installation - Configuration - Usage - How It Works - Requirements - Important Notes - Troubleshooting - Development - Roadmap - Contributing - License The Problem Working on multiple feature branches with different migrations causes pain: More complex migrations could cause the code to stop working like renaming tables, adding foreign keys, or removing columns! The Solution BranchDb automatically manages separate databases for each branch: Each branch has its own isolated database with its own schema and data. Switch branches, restart your server, and you're working with the right database automatically. Installation Add BranchDb to your Gemfile: Install and run the generator: Update your config/database.yml : Note: The rescue fallback ensures production/staging environments work correctly since the gem is only loaded in development/test. Replace myapp with your application name. Initialize your first branch database: Configuration The generator creates config/initializers/branch db.rb : Configuration Options Option Default Description -------- --------- ------------- main branch 'main' Your primary branch name (used as fallback clone source) max branch length 33 ","default_branch":null,"files":null,"tree":[],"storefront":"/r/milkstrawai","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/milkstrawai/branch_db/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}