News for hackers. Stuff that matters.

neilotoole

Re:Sq.io: jq for databases and more on Monday October 07, 2024 @10:54AM (#41766619)
That's an unfortunate naming clash. This "sq" (sq.io) predates the sequoia "sq" by several years I believe.
Re:Sq.io: jq for databases and more on Monday October 07, 2024 @10:47AM (#41766540)
Developer here. Thanks for the kind words.

Substring matching is on my short list (also totally open to a PR!).

Re:Sq.io: jq for databases and more on Monday October 07, 2024 @10:46AM (#41766526)
You can already install sq using several of the common package managers, or build from (Go) source if you prefer.

https://sq.io/docs/install

Re:Sq.io: jq for databases and more on Monday October 07, 2024 @10:44AM (#41766511)
> I'm not really seeing anything I can't do with standard SQL and CLI tools like psql.

Developer here. There's a few features other than the query stuff that I still think are pretty handy.

The "sq inspect" stuff isn't easy to do with the standard CLI tools, or at least wasn't when I started working on sq back in 2013 or so.

https://sq.io/docs/inspect

I also regularly make use of the ability to diff the metadata/schema of different DB instances (e.g. "sq diff @pg_prod @pg_qa").

https://sq.io/docs/diff

Re:Sq.io: jq for databases and more on Monday October 07, 2024 @10:39AM (#41766460)
The theory at the time was that if "SQL" is pronounced like "sequel", and "sq" is just dropping the "L" from "SQL", then "sq" must be...

I suspect the uptake on the "seek" pronunciation is about 2%, if I'm being generous

Re:Sq.io: jq for databases and more on Monday October 07, 2024 @10:30AM (#41766378)
Developer here.

That was exactly the target audience.

Note that sq doesn't just handle relational DBs, it also has (varying quality) support for CSV, JSON, Excel, and so on. At the time (2013) I wasn't aware of a convenient one-liner mechanism for munging all of those together from the command line.

Re:Sq.io: jq for databases and more on Monday October 07, 2024 @10:25AM (#41766331)
> How would I know its outputting the correct SQL? If you mess up joins you end up with bad output.

The generated SQL is output in sq's logs, when logging is enabled.

https://sq.io/docs/config#logging

Re:Sq.io: jq for databases and more on Monday October 07, 2024 @10:24AM (#41766304)
I'm not GP, but I am the sq developer.

> the person just thought “this would be cool to have” and implemented it.

Correct. This is true of much OSS, or at least I've always suspected so.

Re:Sq.io: jq for databases and more on Monday October 07, 2024 @10:21AM (#41766280)
> It's a weird trend that seems almost entirely motivated by people wanting open source projects in their resume

Developer here. I can't speak to what you see as the weird trend, but I can speak about sq's history:

- I created the first version of sq circa 2013 as my own personal dev tool to address some pain points (amongst other things: getting JSON out of various DBs from the command line in a consistent manner, and wanting an easy way to inspect DB schemas, i.e. "sq inspect")

- It was starting to be a minor PITA dealing with colleagues asking for the latest revision of the tool, so I open-sourced it. In 2016 or so I think?

- sq is FL/OSS and will remain so, no funding is sought, not even one of those "buy me a coffee" thingies

- I didn't create this HN post about sq, nor do I know the person who did. But thanks for sq's 15 mins of fame, kind stranger