The service gets query and exports the query's results to a Zipped CSV file.
The request body will be as follow: { "query" : "select * from table where id > 23", "fileName" : "/tmp/testdata.csv" }
Use sbt command
sbt stage- copy akka-http-quickstart-scala_2.13-0.1.0-SNAPSHOT.jar from target\scala-2.13 to to docker-scripts\lib
copy target\scala-2.13\akka-http-quickstart-scala_2.13-0.1.0-SNAPSHOT.jar docker-scripts\lib- build docker image
cd docker-scripts
docker build -t akka-http-query-executor .- run the docker with the db configuration
docker run -e DB_IP="jdbc:postgresql://hh-pgsql-public.ebi.ac.uk:5432/pfmegrnargs" -e DB_USER="reader" -e DB_PASSWORD="NWDMCE5xdipIjRrp" -e DB_DRIVER="org.postgresql.Driver" -e LIMIT_SIZE=7 -p 1234:1234 akka-http-query-executor:latestInvoke the service using Rest client or curl
curl -d "{\"query\":\"SELECT * FROM rnacen.rna ORDER BY upi ASC\",\"fileName\":\"/tmp/testdata.csv\"}" -H "Content-Type: application/json" http://localhost:1234/execute-queryThe result is saved in /tmp/testdata.zip inside the docker container