4 ms·
SQL is the API for data.
by geordee 6y ago
SQL is the API for data.
- jarym 6y ago'Data' is quite broad. If you need results in a tabular format I agree with you - without doubt SQL is the API. But for nested data (XML, JSON, etc.) it really isn't the best language for that. I am talking here specifically about not querying data that is nested, but actually getting query results in a nested format. SQL can do it (almost all major databases have XML and JSON support) but it rally isn't the easiest thing to use.
- geordee 6y agoRight. As the name implies, for structured data. Another way of looking at is, that if we make efforts to structure the data, SQL is pretty good. We should also consider the capabilities of PostgreSQL to query JSON documents.
- touisteur 6y agoI'm wondering if anyone has (good or bad) experience with pg's composite types? They're supposed to allow getting hierarchical data as query results, right? This and arrays should cover most 'simple' use cases?