News for hackers. Stuff that matters.
Re:Ask HN: Tools you have made for yourself? by roveo on Saturday June 12, 2021 @07:35PM (#27488377)
https://github.com/roveo/vertica-query-paste

This is a small script made to do one thing: take an SQL query from the clipboard and output a CSV file with results.

As a data analyst, part of my job was sending results of ad-hoc queries to a bunch of people on slack. The data warehouse was quite slow, so I had to:

- write a query in DataGrip (or any SQL client)

- execute it

- wait for results

- remember that there was a request for data

- save the results to CSV file (with my mouse)

- send it to the person on Slack who asked for it

With many requests per day, many of them concurrent, this was a problem.

With this tool, I just had to write a query, make sure it works, copy it to clipboard and execute:

  vertica-query-paste | slackcat --channel some.person
and not worry about remembering to send it afterwards.

I also had an alias in my shell set to

  vqp=vertica-query-paste | pv -l
and a bunch of shortcuts for slackcat for people that most often asked for ad-hoc query results.

It works with Vertica, but can be generalized to any DB engine that has a CLI client.

Really simple, but probably saved my many hours.

Re:Ask HN: Tools you have made for yourself? by strboul on Sunday June 20, 2021 @11:52AM (#27571248)
I think the solution works for you now but wouldn't be better if you move those recurring queries to a dashboard that people can check the results themselves whenever they want?