Live data from Hacker News

Sq.io: jq for databases and more

sq.io

41–50 of 134 posts

Re: Sq.io: jq for databases and more

#42
post #37

I love JQ. But ... I'd never considered its query language to be particularly admirable. If I want to ask questions of some databases, I don't understand why I'd choose JQ's XPATH-like language to do it.

What I love about `jq` that I can edit my query (or "program") by appending tokens at the end. Similar to unix pipes. With plain SQL that is not easy.

Any language with map/reduce/flatten can more or less do that, no? I agree with your point about SQL though. I find it personally horrible for data-shaping tasks and tend to load everything in memory (as long as feasible).

Re: Sq.io: jq for databases and more

#44

I love JQ. But ... I'd never considered its query language to be particularly admirable. If I want to ask questions of some databases, I don't understand why I'd choose JQ's XPATH-like language to do it.

Presumably the target audience is people who already frequently use JQ and don't want to juggle different query languages when dealing with different data sources?

Re: Sq.io: jq for databases and more

#45

This is interesting. I wonder if there is anything that does the opposite - takes JSON input and allows you to query it with SQL syntax (which would be more appealing to an old-timer like me)

This tool can do that:

    $ cat example.json | sq sql 'SELECT * FROM data'
    actor_id  first_name  last_name  last_update
    1         PENELOPE    GUINESS    2020-06-11T02:50:54Z
    2         NICK        WAHLBERG   2020-06-11T02:50:54Z
One of the data source types is 'json' and the command 'sq sql ...' lets you execute SQL directly instead of using their default query language (SLQ).

Re: Sq.io: jq for databases and more

#48
Sometimes I wonder if it wouldn't be more efficient for people to just learn SQL instead of trying to build tools or layers on top of it that introduce more complexities and are harder to search for.

Re: Sq.io: jq for databases and more

#49
post #48

Sometimes I wonder if it wouldn't be more efficient for people to just learn SQL instead of trying to build tools or layers on top of it that introduce more complexities and are harder to search for.

HN is inundated with posts announcing paper thin abstractions on top of existing technology or utilities that just move the goalpost of what you knowledge you need to be effective. It's a weird trend that seems almost entirely motivated by people wanting open source projects in their resume, or seek funding if its a startup.

Re: Sq.io: jq for databases and more

#50

I love JQ. But ... I'd never considered its query language to be particularly admirable. If I want to ask questions of some databases, I don't understand why I'd choose JQ's XPATH-like language to do it.

This!

JQ is great because JSON didn't have a query language & needed one. JQ isn't the best query language - it's just the one that won adoption.

DBs already have query languages that are mostly superior to JQ's.

Post reply on HN