Executes a SQL statement and returns the results. Supports requests for both regular and streaming responses.
With streaming, results return as they become available using HTTP chunked transfer encoding. Each chunk contains a valid JSON object that you can parse independently.
You can specify the database in the request body. If you do not specify the database, the Ocient System defaults to the database specified in the authentication token or system settings.
Access token obtained from the /v1/login endpoint.
Include in the Authorization header as: Bearer {token}
Specifies the request body format.
For queries expected to return large result sets, use application/stream+json with Accept header.
application/json, text/plain Supported response media types. The API returns large query results using chunked encoding.
application/json, application/stream+json, application/parquet Supported compression algorithms for responses. You can specify multiple algorithms as a comma-separated list.
Note: For large result sets, compression can impact performance. Without compression, result sets can be processed in a streaming fashion. With compression, the entire result set must be compressed before it is returned to the client.
Indicates the preferred encoding type from those specified in the Accept-Encoding parameter.
gzip, br Specifies the compression level for the selected encoding algorithm. Values range from 1 (fastest, least compression) to 9 (slowest, maximum compression).
1 <= x <= 9A valid SQL statement to execute
Target database for the query
Response format:
array - Returns schema and data as arrays (more efficient for large data sets)collection - Returns data as JSON objects (more convenient for client processing)array, collection Parameters to substitute in the SQL statement for values enclosed in braces. The keys should match the parameter names in the statement (without the enclosing braces).
Number of rows to return in each chunk for streaming responses. Use 0 to let the database determine the size.
x >= 0Maximum number of rows to return
The schema to use for the SQL statement