Open pbsds opened 2 years ago
I would take a look at PartiQL / SQL++. It offers language extensions to SQL for semi-structured hierarchical data such as JSON. https://partiql.org/
Microsoft SQL Server have support for JSON too. https://learn.microsoft.com/en-us/sql/t-sql/functions/json-query-transact-sql?view=sql-server-ver16
Believe it or not, many use SQL tables as a document store, dumping massive amounts of JSON into a column and querying these. Each SQL engine manipulates the JSON objects differently:
Postgres provides various homegrown infix operators to filter and query the JSON objects, while MySQL and Sqlite simply provide a bunch of functions that take the json blob as input.
a[b]
), optionally with null-conditional and coalescing operators like in c# (a?[b ?? 0]
)