typhon-project / typhonql

Typhon Query Language
Eclipse Public License 2.0
4 stars 1 forks source link

[Feature] Queries should return a flat result table instead of objects #52

Closed DavyLandman closed 4 years ago

DavyLandman commented 4 years ago

Is your feature request related to a problem? Please describe. We want to make it easier to consume the QL api and have noticed the WorkingSet definitions are a bit complex to interpret (especially in case of nested entities and references). We are deprecating those results sets in favor of a simple table like result. The columns in the result will be based on the selected fields, just like a normal SQL query.

Describe the solution you'd like

@pinoval summarized it in an email recently:

For instance, for a query such as:

from User u, CreditCard c
select u.name, c.balance, u.biography.content

where u.biography is a relation, the result table would be like this:

-----------------------------------------------
|  u.name  | c.balance | u.biography.content. |
-----------------------------------------------
|  "Tijs"  |   1000    |      "Researcher"    |
|   ...    |    ...    |         ...          |
-----------------------------------------------

The json representation of this will be like:

{   columns: [ "u.name", "c.balance", "u.biography.content"],
    values: [
               [ "\"Tijs\"", "1000", "\"Researcher\""],
               ...
            ]
 }