https://github.com/rueian/pgbroker-static
A PostgreSQL proxy that can map multiple PGs into one entry. And easy to do query rewrite in golang.
https://github.com/rueian/pgbroker-static
docker golang postgres postgresql proxy
Last synced: about 1 year ago
JSON representation
A PostgreSQL proxy that can map multiple PGs into one entry. And easy to do query rewrite in golang.
- Host: GitHub
- URL: https://github.com/rueian/pgbroker-static
- Owner: rueian
- Created: 2020-03-02T19:36:19.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2021-03-18T17:33:15.000Z (over 5 years ago)
- Last Synced: 2025-03-24T17:55:16.909Z (over 1 year ago)
- Topics: docker, golang, postgres, postgresql, proxy
- Language: Go
- Homepage:
- Size: 17.6 KB
- Stars: 10
- Watchers: 2
- Forks: 3
- Open Issues: 1
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
# pgbroker-static
A simple postgresql proxy that can map multiple pg instances into one entry by a static YAML configuration.
The proxy is built with [pgbroker](https://github.com/rueian/pgbroker), which makes it easy to support dynamic database mappings from an external resource controller and modification on data transferred between client and pg in streaming or per message manner.
## Usage
```bash
docker pull rueian/pgbroker-static:latest
```
## Example
### configuration
See [./example/config.yml](./example/config.yml)
```yaml
---
databases:
entrydb: # <- the database name you sent in the Startup Message
datname: postgres # <- the actual database name of the target pg instance
address: postgres:5432 # <- the actual tcp address of the target pg instance
```
### pgbench
See [./docker-compose.yml](./docker-compose.yml)
## Dynamic database mapping from an external resource controller
Please checkout the [godemand-example](https://github.com/rueian/godemand-example) project, which uses [godemand](https://github.com/rueian/godemand) as an external http resource controller for dynamic pg mapping.