Original Summary

I spent the last few weeks building BranchBase because I was honestly losing my mind constantly wiping and resetting my local Postgres container. Whenever I'm halfway through a feature branch that modifies DB schemas (adding columns, renaming tables) and have to jump back to main to hotfix a bug or review a PR, the app immediately crashes with column does not exist or pending migration errors. My muscle memory used to be running docker compose down -v && docker compose up -d and waiting 10 minutes for seeds to re-run. So I wrote a tool to automate this locally. Basically, you point your app's DATABASE_URL to localhost:5433 (the BranchBase proxy) instead of your regular port 5432. When you run git checkout feature-auth, it detects the branch switch, clones your base database in a few milliseconds, and silently routes your app to mydb_feature_auth. When you switch back to main, your queries instantly route back to mydb_main. Once you merge or delete the Git branch, running branchbase prune cleans up the leftover databases so your disk doesn't fill up. It's written in pure Go (standard library only, no heavy web frameworks), runs as a single binary on macOS/Linux/Windows, and supports PostgreSQL, MySQL, and SQLite (using copy-on-write syscalls on Linux/Mac). It's 100% local, no cloud accounts, and MIT licensed. Repo: https://github.com/oscarbol09/branchbase Docs: https://oscarbol09.github.io/branchbase/ Curious to know how you guys currently deal with local migration drift when switching branches.   submitted by   /u/UnnamedX_O [link]   [comments]


  • 情报分类:技术学习与提效
  • 分类依据:内容涉及技术、AI、软件工具或工程实践
  • 信息来源:Reddit · SideProject
  • 发布时间:2026/9/19 03:01:22