Issue/Question | Decision | Notes |
---|---|---|
What is the proposed approach to be used in CPS? Do we use the approach as per postgREST where the REST queries are executed directly as database queries without the need of any ORM? | As per an exchange on Slack, we are not going with the postgREST model. And instead stick to using the cps-ri layer as it is? https://onapproject.slack.com/archives/C03UJAZAV3K/p1711714427478109 | |
The proposal says the search parameter will look something like this, ?select=name, price.gt.100. But in the postgREST documentation we can see that entities like name and price are considered columns in a data base while in this proposal these are mentioned as leaf data node. | ||
postgREST implements operators that are translated to SQL queries, for example "eq" translated to =. How do we implement these operators in our approach? | ||
How to handle parsing of requests. And multiple search requests. | ||
Need to define Structure of data being returned, just returning a leaf can be confusing as leaves with same name can exist under different data nodes | ||
Need grammar to handle the search equation and different kinds of data types in the search, for instance Strings, Arrays and Integers in a query. These can be sent individually in a request or maybe combined in same request as well. |
CPS query API can be further improved to support more generic query parameters or request parameters where we can provide request input like JSON and that will be parsed to SQL query. these parameters are optional and provides more generic approach to query from large data.
So, we are proposing to use generic SQL query like request parameters along with cps-path for enhanced query operations. these parameters will be parsed to SQL statement for query operation.
Query Data nodes API will be enhanced with extra optional query parameter
API: GET http://<IP>:<PORT>/cps/v2/dataspaces/{dataspace-name}/anchor/{anchor-name}/nodes/query?select={generic_query_parameter}
Parameter Name | Objective | Examples |
---|---|---|
select | To query only selected fields for a given cps-path. | ?select=title, price ?select=name, price.gt.100 |
Tables and Views — PostgREST 12.0 documentation