A CLI tool that enables Git-like branching for PostgreSQL databases to simplify local development workflows.
pgsh is a command-line tool that streamlines PostgreSQL database management during local development. It allows developers to branch, clone, and switch between database states effortlessly, reducing the pain of migrations and context switching by managing connection strings in .env files.
Developers working on PostgreSQL-backed applications who use environment-based configuration (like dotenv) and need to manage multiple database states locally, especially those using knex for migrations.
Developers choose pgsh for its Git-like branching workflow for databases, which simplifies context switching and feature isolation, and its seamless integration with knex migrations and .env-based configuration, adhering to Twelve-Factor App principles.
Branch your PostgreSQL Database like Git
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Enables creating and switching between database branches similar to Git, as shown in the branching model docs, which simplifies parallel feature development and reduces context-switching pain.
Automatically updates database connection strings in .env files when switching branches, adhering to Twelve-Factor App principles and reducing manual configuration errors.
Provides user-friendly commands for knex migrations (e.g., up, down, validate), making migration workflows more intuitive and less error-prone, as highlighted in the command reference.
Uses PostgreSQL's native tools like pg_dump for cloning and dump/restore operations, ensuring reliable and isolated environments for testing or experimentation.
Exclusively supports PostgreSQL, so it's useless for projects using other databases, and the README doesn't mention plans for broader database support.
Requires projects to use .env files and environment-based configuration; the README notes limited maturity for non-JavaScript ecosystems, making it less flexible for heterogeneous tech stacks.
Commands like 'pgsh destroy' can permanently delete databases, and while a blacklist option exists, it requires manual configuration and careful oversight, posing a risk in collaborative environments.