4 ms·
While i agree about the general sentiment on preferring well defined and explicit standard as opposed to "cute" custom made languages. In this case i am not con
by soulbadguy 3y ago
While i agree about the general sentiment on preferring well defined and explicit standard as opposed to "cute" custom made languages. In this case i am not convince that SQL would be the best candidate for querying nested structures like JSON.Something like xpath maybe.
- jjeaff 3y agoI agree, it wouldn't be the best to handle all json edge cases, but it would be a super easy way to quickly get data from a big chunk of simple json and you could just use subqueries or query chaining for nested results. For anyone who hasn't used powershell, this is the difference I'm talking about. I would not be able to write either of these without looking up the syntax. But knowing very little about powershell, I can tell exactly what that command means while the bash command, not so much. ```powershell $json | ConvertFrom-Json | Select-Object -ExpandProperty x ``` ```bash echo $json | jq '.x' ```
- deredede 3y agoOn the other hand, I find the bash one clear and concise. That PowerShell example is so verbose, it'd drive me crazy to do any sort of complex manipulation this way! To each their own, I guess.
- jjeaff 3y agoIf all I was doing is writing code, I agree. But like most developers, I think I read a lot more code than I write.
- deleted 3y ago[deleted]
- tubthumper8 3y agoJSONPath? https://datatracker.ietf.org/doc/id/draft-goessner-dispatch-jsonpath-00.html https://datatracker.ietf.org/doc/id/draft-goessner-dispatch-...