A utility for creating and loading PostgreSQL database dumps.
- Create database dumps from different environments
- Automatic management of local PostgreSQL in Docker
- Load dumps into local database
- Support for multiple environments
- Debug mode for detailed information
- Clone the repository:
git clone https://github.com/your-username/dumper.git
cd dumper- Install dependencies:
go mod download- Copy example configuration and edit it:
cp config.example.yaml config.yamlEdit config.yaml and specify your database connection parameters:
environments:
- name: dev
db_dsn: postgres://user:password@dev-host:5432/database?sslmode=disable
- name: stage
db_dsn: postgres://user:password@stage-host:5432/database?sslmode=verify-full- Run the utility:
go run . [--debug]- Select environment from the list
- Use available commands:
- Create dump
- Load dump into local database
- Change environment
- Go 1.21 or higher
- Docker
- PostgreSQL client (for creating dumps)