Selectosaur is a CLI tool. It runs SQL queries on Timescale DB based on user-supplied parameters and outputs stats for them.
Wrote it as part of my job application at TimescaleDB.
It is recommended that you build this app on a 64-bit Mac or Linux machine with Golang version 1.17
.
- Clone this repo on to your system
- Navigate to the root directory of this project and run
go build
to generate the binary. Alternatively, download a binary suitable for your platform from the Releases page. - Ensure that the binary has execution permissions on your system. For Linux/MacOS, you can run
chmod +x ./selectosaur
. - Test the binary by invoking
./selectosaur -h
. This should display the main help message of the CLI.
- Ensure that your query params CSV file
query_params.csv
is in the same directory as the CLI. - Run the below commands:
# NOTE: this is a temp timescale DB cluster which will be taken down soon. Enjoy for now.
export DB_CONNECTION_STRING="postgres://tsdbadmin:[email protected]:31703/tsdb?sslmode=require"
$ ./selectosaur --qp query_params.csv --worker-count 10
Total number of queries run: 200
Number of failures: 0
Total time across all queries: 329.820000 ms
Average query time: 1.649100 ms
Minimum query time: 1.349000 ms
Maximum query time: 2.998000 ms
Median query time: 1.462000 ms
They liked my assignment but I got turned down after subsequent interviews :/