# README
Go PostgreSQL Dump
A utility to dump PostgreSQL database schema (tables, functions, and procedures) to individual .sql files.
Requirements
- Go (1.18+)
- PostgreSQL
- pg_dump CLI installed
Installation
- Clone this repository.
- Ensure you have Go installed.
- Run
go mod download
to retrieve dependencies.
Configuration
Provide a .env file in the project root directory:
DATABASE_URL="postgres://username:password@hostname:5432/dbname?sslmode=disable"
DUMP_DIR=./db_dump
• DATABASE_URL: Connection string to your PostgreSQL database.
• DUMP_DIR: Output directory for dump files.
Usage
-
Build and run the project:
go build -o go-pgdump ./go-pgdump
-
Check the DUMP_DIR for dumped .sql files.