https://github.com/01walid/pg_branch
[WIP] Branch your development postgres database like you do in git
https://github.com/01walid/pg_branch
database database-management developer-tools devops-tools devtools postgres postgresql workflow
Last synced: about 1 year ago
JSON representation
[WIP] Branch your development postgres database like you do in git
- Host: GitHub
- URL: https://github.com/01walid/pg_branch
- Owner: 01walid
- License: apache-2.0
- Created: 2022-01-30T00:10:42.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2022-09-10T12:49:44.000Z (almost 4 years ago)
- Last Synced: 2025-05-07T02:03:48.386Z (about 1 year ago)
- Topics: database, database-management, developer-tools, devops-tools, devtools, postgres, postgresql, workflow
- Language: Rust
- Homepage:
- Size: 655 KB
- Stars: 12
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# pg_branch
[](https://github.com/01walid/pg_branch/actions/workflows/tests.yml)
[](https://github.com/01walid/pg_branch/actions/workflows/clippy.yml)
[](https://github.com/01walid/pg_branch/actions/workflows/rustfmt.yml)

- :elephant: Branch your development Postgres DB like you do in Git!
- 🚀 Fast DB copying, no
pg_dump/pg_restore(by default)!
- :computer: Rust-based single binary, supports Windows, Linux & Mac.
- :open_file_folder: 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

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