This is very simple service for proxy tcp and dump plain queries to a file (supported only Postgres).
Linux is preferred environment.
Need to install docker first.
Run service in the container (log output to the current folder ${PWD}):
docker build -f Dockerfile.build -t alekns/dbproxy .
docker run --name dbproxy-dev --rm -t -p 54321:54321 -v ${PWD}:/usr/src/app/log alekns/dbproxy build/DbProxy --db-type pgsql --workers 4 --log-file log/dbproxy.log --local-port 54321 --local-ip 0.0.0.0 --upstream-port 5432 --upstream-ip YOUR_REMOTE_POSTGRES_HOST
Run tests:
docker run --name dbproxy-dev-tests --rm -ti alekns/dbproxy sh -c "cd build ; ctest"
Use it to force stop container
docker kill dbproxy-dev
.
- C++14
- CMake >= 3.5
- Boost ~1.62
$ mkdir -p build
$ cd build
$ cmake ..
$ make
$ ./DbProxy --db-type pgsql --workers 4 --local-port 54321 --local-ip 127.0.0.1 --upstream-port 5432 --upstream-ip 127.0.0.1
$ ctest