An open API service indexing awesome lists of open source software.

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

Awesome Lists containing this project

README

          

# pg_branch
[![Tests](https://github.com/01walid/pg_branch/actions/workflows/tests.yml/badge.svg)](https://github.com/01walid/pg_branch/actions/workflows/tests.yml)
[![Clippy](https://github.com/01walid/pg_branch/actions/workflows/clippy.yml/badge.svg)](https://github.com/01walid/pg_branch/actions/workflows/clippy.yml)
[![Rustfmt](https://github.com/01walid/pg_branch/actions/workflows/rustfmt.yml/badge.svg)](https://github.com/01walid/pg_branch/actions/workflows/rustfmt.yml)

Branch your postgres database like you do in Git


  • :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

![pg_branch](https://user-images.githubusercontent.com/983020/153002119-3c846525-f4bc-4514-9d38-0b51f7e416a0.svg)

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?