Hacker News new | past | comments | ask | show | jobs | submit login
Show HN: KSON Is JSON with SQL and Networking (gitlab.com/jacob.brazeal)
22 points by tibbar on Aug 4, 2021 | hide | past | favorite | 5 comments



     {
       "source": <<!https://raw.githubusercontent.com/datasets/gdp/master/data/gdp.csv>> as gdp,
      "bot5GDPs": ```select \* from "$gdp"
                 where year in (select max(year) from "$gdp")
                order by value desc
                 limit 5;```
      }
https://media.giphy.com/media/vyTnNTrs3wqQ0UIvwE/giphy.gif

It would be better to convert the SQL request to JSON on the backend, already sorted, and return the table as just data. The raw query with variables in the string gives me bad PHP flashbacks.


Ah, but there is no inherent backend: this is a raw format, and you can “execute” it, on a backend if you like, to get a regular json document.


Ok. But why would I want to?

If I already have a database with the necessary schema, I can just take the CSV file and populate it. What's the point of KSON in the middle?


One (artificial) example is the second one that does a join on a csv file hosted one place and a json file hosted somewhere else. Essentially, a lot of data exploration comes down to “fetch data from these locations, transform the structure in various ways, and maybe run some sql on the result.” KSON is basically a declarative way to do that. Another in the long line of code-> data transformations.


Granted, though, this more of a data munging tool, and I’d be pretty scared to see this used in production.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: