{"id":16776999,"url":"https://github.com/rueian/pgbroker","last_synced_at":"2025-09-05T12:38:48.682Z","repository":{"id":57515540,"uuid":"173607821","full_name":"rueian/pgbroker","owner":"rueian","description":"A golang library for building PostgreSQL proxy","archived":false,"fork":false,"pushed_at":"2025-02-07T20:38:46.000Z","size":65,"stargazers_count":33,"open_issues_count":1,"forks_count":9,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-02-27T16:49:12.313Z","etag":null,"topics":["golang","pg","postgresql","protocol","proxy"],"latest_commit_sha":null,"homepage":null,"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/rueian.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","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":"2019-03-03T17:37:29.000Z","updated_at":"2025-02-23T18:25:53.000Z","dependencies_parsed_at":"2024-03-26T11:44:06.543Z","dependency_job_id":"130aff0a-f101-4a78-99ff-209a90c844d1","html_url":"https://github.com/rueian/pgbroker","commit_stats":null,"previous_names":["rueian/pgborker"],"tags_count":18,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rueian%2Fpgbroker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rueian%2Fpgbroker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rueian%2Fpgbroker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rueian%2Fpgbroker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rueian","download_url":"https://codeload.github.com/rueian/pgbroker/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243841125,"owners_count":20356440,"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":["golang","pg","postgresql","protocol","proxy"],"created_at":"2024-10-13T07:11:35.143Z","updated_at":"2025-03-17T02:31:36.196Z","avatar_url":"https://github.com/rueian.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# pgbroker\n\npgbroker is a golang library for building PostgreSQL proxy, which makes it easy to support from simple query logging to complex dynamic database mappings from an external resource controller and modification on data transferred between client and pg in streaming or per message manner.\n\n## Usage\n\n### static proxy\n\nOne example usage of pgbroker is just simple mapping multiple pg instances into one entry for centralizing management.\n\nPlease checkout the https://github.com/rueian/pgbroker-static project.\n\nIt is a production ready postgres proxy configured by a yaml file, and it is also has a pre-build docker image.\n\n```shell\ndocker pull rueian/pgbroker-static:latest\n```\n\n### dynamic proxy\n\nBy implementing the `PGResolver` interface, the proxy is able to acquire different connections based on the client's `StartupMessage`.\n\n```golang\ntype PGResolver interface {\n\tGetPGConn(ctx context.Context, clientAddr net.Addr, parameters map[string]string) (net.Conn, error)\n}\n```\n\nPlease check out the https://github.com/rueian/godemand-example project, which uses godemand as an external http resource controller for dynamic pg mapping.\n\nIn this way, the external resource controller is able to do any change to the postgres before connection estiblished, including creating new postgres instance on the fly.\n\n### data modification\n\npgbroker provides `MessageHandler` and `StreamCallback` for each postgres protocol v3 messages. Developers can use them to easily modify the data transferred between client and pg in streaming or per message manner.\n\nIt is useful when implementing such as data obfuscation and permission control.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frueian%2Fpgbroker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frueian%2Fpgbroker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frueian%2Fpgbroker/lists"}