Queries
The query endpoint accepts a query request, containing expressions to be evaluated in the context the data source, and returns a response consisting of relevant rows of data.
The structure and requirements for specific fields listed below will be covered in subsequent chapters.
Request
POST /query
Request
See QueryRequest
Request Fields
Name | Description |
---|---|
collection | The name of a collection to query |
query | The query syntax tree |
arguments | Values to be provided to any top-level collection arguments |
collection_relationships | Any relationships between collections involved in the query request |
variables | One set of named variables for each rowset to fetch. Each variable set should be subtituted in turn, and a fresh set of rows returned. |
Response
See QueryResponse
Requirements
- If the request specifies
variables
, then the response must contain oneRowSet
for each collection of variables provided. If not, the data connector should respond as ifvariables
were set to a single empty collection of variables:[{}]
. - If the request specifies
fields
, then the response must containrows
according to the schema advertised for the requestedcollection
. - If the request specifies
aggregates
then the response must containaggregates
, with one response key per requested aggregate, using the same keys. See aggregates. - If the request specifies
arguments
, then the implementation must validate the provided arguments against the types specified by the collection's schema. See arguments.