Loadmill's Database Relay Service provides a simple way to interact with your databases using HTTP requests as part of API and integration tests. By enabling the execution of queries directly to PostgreSQL, MySQL, Oracle, MongoDB, and Redis databases, it greatly simplifies the incorporation of databases in your API tests. The ability to query data sources and assert over the response during a test serves as a powerful tool for validating test results.
Execute queries directly to postgres:
https://<www.your-domain.com>/api/postgres
body: {
connectionString: 'postgres://...'
query: 'SELECT NOW()'
}
Execute queries directly to mysql:
https://<www.your-domain.com>/api/mysql
body: {
connectionString: 'mysql://...'
query: 'SELECT NOW()'
}
Execute queries directly to oracle:
https://<www.your-domain.com>/api/oracle
body: {
connectionString: 'host[:port][/service_name]'
user: 'database-user'
password: 'mypw'
query: 'SELECT * FROM table_name'
}
Execute queries directly to mongodb:
https://<www.your-domain.com>/api/mongo
body: {
connectionString: 'mongodb://...'
collection: 'bios',
command: 'find',
query: { "awards.award": "Turing Award" }
}
Execute queries directly to redis:
https://<www.your-domain.com>/api/redis
body: {
{
connectionString: "redis://...",
command:"get | hget | hgetall"
key:"any-key",
field: "any-field"
}
}
Build docker image:
docker build -t db-relay-service .
Build docker container:
docker run -it -p 8080:8080 db-relay-service
Stop docker container:
docker ps
docker stop ${CONTAINER ID}