4 ms·
I just want to say this is really cool. Honestly I'd love to see SQL (or something like it) become a first-class citizen in operating systems generally -- as a
by crazygringo 6y ago
I just want to say this is really cool.
Honestly I'd love to see SQL (or something like it) become a first-class citizen in operating systems generally -- as a standard way for manipulating files, logs, preference files, etc.
To be clear: not turning things into databases (keep logs as logs), but make everything interpretable to SQL.
It's bizarre to me that in just a few lines I can achieve magic with a database... but I can't trivially do the same magic with my filesystem.
Just like a shell is an integral part of an OS... shouldn't a query language be too? I'd love it if, out-of-the-box, Linux distributions came with a standardized SQL+JSON-over-the-filesystem approach that functioned as a small-scale working database for any tool that wanted to use it as such.
- aratno 6y agoHave you used osquery? Seems like a good chunk of what you’re looking for! https://www.osquery.io/schema/4.7.0/ https://www.osquery.io/schema/4.7.0/
- crazygringo 6y agoIt's halfway what I'm talking about, thanks. Absolutely yes to the idea of being able to query everything! But for me the idea of writing (CREATE, UPDATE, DELETE) would be an integral part of it as well -- whether inserting a property into a JSON file, adding a cronjob as column parameters rather than a text line, or creating files.
- neolog 6y agoThe writing part is what NixOS does (with Nixlang rather than SQL).
- mcint 6y agoSee also https://augeas.net/ https://augeas.net/, which presents structured file contents as navigable paths that you update. Red hatters maintained it (hung out in irc) until cloud container workflows surpassed in-place system administration. It pairs nicely with puppet, and can be used manually.
- CyberDildonics 6y agoThis has been cool every time it has come back around. It is a shame it isn't more universal. One simple recipe would be to read the file tables directly for speed (like the program 'Everything') and put it in an sqlite db. Something that at least gets halfway is 'Everything' since it indexes files extremely quickly, sorts on multiple attributes extremely quickly, and allows regular expressions. It would be better if these things were built into the OS so that tools could be built on top of them.
- mjgs 6y agoGood point. SQL is very powerful for somethings. Having some cli tools that focussed on this would be relatively easy to implement, and you could even create a special GUI based tool. What do you have in mind when it comes to it being a “first class citizen” of the OS?
- omgwtfbyobbq 6y agoAre you thinking of something like WMI? https://docs.microsoft.com/en-us/windows/win32/wmisdk/querying-with-wql https://docs.microsoft.com/en-us/windows/win32/wmisdk/queryi...
- maest 6y agoq is a general use programming language that has a subset of sql embedded inside of it. And it's amazing. You can write stuff as: c : a + b select col from my_table where other_col > c So no more faffing around with manually building queries, and queries are ran by the same process that has access to all your variables.