{"id":26633698,"url":"https://github.com/mhkarimi1383/pg_pro","last_synced_at":"2025-10-05T14:11:42.139Z","repository":{"id":134361042,"uuid":"596702298","full_name":"mhkarimi1383/pg_pro","owner":"mhkarimi1383","description":"We want to achieve to a great layer over PostgreSQL, with caching, advanced user management and master/replica load balancing. ","archived":false,"fork":false,"pushed_at":"2023-08-14T16:26:31.000Z","size":17458,"stargazers_count":14,"open_issues_count":12,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-24T15:15:58.000Z","etag":null,"topics":["cache","caching","database","load-balancer","postgres","postgresql","user-management"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mhkarimi1383.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-02-02T18:53:05.000Z","updated_at":"2024-07-19T15:56:25.000Z","dependencies_parsed_at":"2024-06-21T19:13:20.307Z","dependency_job_id":null,"html_url":"https://github.com/mhkarimi1383/pg_pro","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mhkarimi1383%2Fpg_pro","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mhkarimi1383%2Fpg_pro/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mhkarimi1383%2Fpg_pro/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mhkarimi1383%2Fpg_pro/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mhkarimi1383","download_url":"https://codeload.github.com/mhkarimi1383/pg_pro/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248262043,"owners_count":21074237,"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","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":["cache","caching","database","load-balancer","postgres","postgresql","user-management"],"created_at":"2025-03-24T15:16:06.856Z","updated_at":"2025-10-05T14:11:42.011Z","avatar_url":"https://github.com/mhkarimi1383.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# pg_pro\n\n![banner](./assets/banner.jpg)\n\nWe want to achieve to a great layer over PostgreSQL, with caching, advanced user management and master/replica load balancing.\n\n\n## Stability\nWe do not recommend to use this project right now wait for [this issue](https://github.com/mhkarimi1383/pg_pro/issues/24) to get done\n\n## Features\n\n- [x] Parsing Query and checking relation info\n- [x] Caching (By understanding the type of the query)\n- [x] User Management (only yaml provider)\n- [x] LoadBalancing (By query type [read/write])\n- [ ] Automatic master/slave detection\n\n## Why\n\nFirst of all, That's funny and I want to learn how PostgreSQL works (as for connections)\n\nAs for User management goes, This project is usefull when you want to manage users with a centeral DB (like OpenLDAP, or a centeral `yaml` file) I only found [Squarespace/pgbedrock](https://github.com/Squarespace/pgbedrock) but it's inactive for 3 years... Also I want to manage users without postgresql itself ;)\n\nAs for loadbalancing goes that's great to loadbalance connections to servers in a smart way (By understanding what is the query)\n\nFor caching I want to make it posible to use any kind of caching for your database, since postgresql caching parameters are so hard to configure them in a good way.\n\n## How loadbalancer works\n\nWhen project starts it will make a connection pool to each server that is listed in the `config.yaml` file\n\nwhen a quey comes, it will parse given query, then it will return an error to user (if there is any error within the query)\n\nwe will select one of the servers to loadbalance between them\n\n## Configuration\n\nCheckout `config.yaml` file this file could be in one of theas directories:\n\n- /etc/pg_pro/\n- $HOME/.pg_pro\n- $PWD\n\n## Building/Local Development\n\na Working go environment\n\nyou have to set `CGO_ENABLED=1`, since we are using [pganalyze/pg_query_go](https://github.com/pganalyze/pg_query_go) to parse queries\n\nI would recommend to use [cosmtrek/air](https://github.com/cosmtrek/air) for hot reloading and having up-to-data `go build` options\n\nor you can just use `docker` to build/deploy the project\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmhkarimi1383%2Fpg_pro","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmhkarimi1383%2Fpg_pro","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmhkarimi1383%2Fpg_pro/lists"}