Thanks to visit codestin.com
Credit goes to github.com

Skip to content

01walid/pg_branch

Repository files navigation

pg_branch

Tests Clippy Rustfmt

Branch your postgres database like you do in Git

  • 🐘 Branch your development Postgres DB like you do in Git!
  • 🚀 Fast DB copying, no pg_dump / pg_restore (by default)!
  • 💻 Rust-based single binary, supports Windows, Linux & Mac.
  • 📂 Auto-discovers your Git setup & branches.

Warning: This is a work in progress.

Why?

Ever wanted to test a migration in isolation? then revert back to your main development database quickly? Or test a pull request or a feature-branch without the need to give up your development database's data or schema.

pg_branch goal is to help provide quick copies of your current development database, then help you manage those copies (drop, rename, cleanup, ..etc). This is especially usefull when provisioning "preview environments" that are a copy of staging/prod, e.g. a database per Vercel PR preview.

Demo

pg_branch

TODO:

  • More tests
  • Git hooks / Husky support
  • Pre-built binaries for Mac/M1, Linux & Windows.
  • npm package
  • switch --no-rename mode
  • pg_branch run <shell|os> command> for the no-rename mode.
  • VCS agnostic?

About

[WIP] Branch your development postgres database like you do in git

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published