{"id":21657240,"url":"https://github.com/zcubbs/pgc","last_synced_at":"2026-05-07T01:03:41.065Z","repository":{"id":200641306,"uuid":"706044699","full_name":"zcubbs/pgc","owner":"zcubbs","description":"🌱 pgc is a CLI that automates the initialization process of a PostgreSQL database.","archived":false,"fork":false,"pushed_at":"2023-10-17T08:50:24.000Z","size":16,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-08-22T06:00:19.539Z","etag":null,"topics":["config","postgres"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zcubbs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-10-17T07:44:53.000Z","updated_at":"2023-10-17T07:46:42.000Z","dependencies_parsed_at":null,"dependency_job_id":"74c3a62a-750a-4d72-bfaa-78c7523493d5","html_url":"https://github.com/zcubbs/pgc","commit_stats":null,"previous_names":["zcubbs/pgc"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/zcubbs/pgc","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zcubbs%2Fpgc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zcubbs%2Fpgc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zcubbs%2Fpgc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zcubbs%2Fpgc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zcubbs","download_url":"https://codeload.github.com/zcubbs/pgc/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zcubbs%2Fpgc/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271601660,"owners_count":24788097,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-22T02:00:08.480Z","response_time":65,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["config","postgres"],"created_at":"2024-11-25T09:20:09.459Z","updated_at":"2026-05-07T01:03:36.046Z","avatar_url":"https://github.com/zcubbs.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# `pgc` PostgreSQL Initializer\n\n`pgc` is a CLI that automates the initialization process of a PostgreSQL database. It creates users, databases, assigns privileges, updates the `pg_hba.conf` file, and restarts the PostgreSQL service.\n\n[![tag](https://img.shields.io/github/tag/zcubbs/pgc)](https://github.com/zcubbs/pgc/releases)\n![Go Version](https://img.shields.io/badge/Go-%3E%3D%201.21-%23007d9c)\n[![GoDoc](https://godoc.org/github.com/zcubbs/pgc?status.svg)](https://pkg.go.dev/github.com/zcubbs/pgc)\n[![Lint](https://github.com/zcubbs/pgc/actions/workflows/lint.yaml/badge.svg)](https://github.com/zcubbs/pgc/actions/workflows/lint.yaml)\n[![Scan](https://github.com/zcubbs/pgc/actions/workflows/scan.yaml/badge.svg?branch=main)](https://github.com/zcubbs/pgc/actions/workflows/scan.yaml)\n![Build Status](https://github.com/zcubbs/pgc/actions/workflows/test.yaml/badge.svg)\n[![Go Report Card](https://goreportcard.com/badge/github.com/zcubbs/pgc)](https://goreportcard.com/report/github.com/zcubbs/pgc)\n[![Contributors](https://img.shields.io/github/contributors/zcubbs/pgc)](https://github.com/zcubbs/pgc/graphs/contributors)\n[![License](https://img.shields.io/github/license/zcubbs/pgc.svg)](./LICENSE)\n\n## Prerequisites\n\n- A running PostgreSQL instance.\n- A user with `CREATEDB` and `CREATEROLE` privileges.\n- A user with `LOGIN` privileges.\n\n## Installation\n\n```bash\ncurl -sfL https://raw.githubusercontent.com/zcubbs/pgc/main/install.sh | bash\n```\n\n## Usage\n\n```bash\npgc -c config.yaml\n```\n\n## Configuration\n\nEdit the `config.yaml` file to set up the PostgreSQL configurations, users, databases, and privileges. Below are the configurable sections:\n\n- `postgresql`: PostgreSQL connection details such as host, port, user, and password.\n- `databases`: List of databases to be created along with their owners.\n- `users`: List of users to be created along with their passwords.\n- `privileges`: Privileges to be granted to users on specific databases.\n- `pg_hba`: pg_hba configuration details.\n- `pg_hba_conf_path`: Path to the `pg_hba.conf` file.\n- `restart_cmd`: Command to restart the PostgreSQL service.\n\n## Development\n\n### Prerequisites\n\n- [Go](https://golang.org/doc/install)\n- [Task](https://taskfile.dev/#/installation)\n\n### Run Test Using Docker\n\n1. Build the Docker image:\n\n```bash\ndocker build -t pgc . \u0026\u0026 docker run --rm --name pgc -p 5432:5432 pgc\n```\n\nthe test config file `config.yaml` will be used.\n\n## License\n\nHuB is licensed under the [MIT](./LICENSE) license.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzcubbs%2Fpgc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzcubbs%2Fpgc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzcubbs%2Fpgc/lists"}