All URIs are relative to http://127.0.0.1:9308
| Method | HTTP request | Description |
|---|---|---|
| sql | POST /sql | Perform SQL requests |
Map<String, Array> sql(body, rawResponse)
Perform SQL requests
Run a query in SQL format.
Expects a query string passed through body parameter and rawResponse parameter that defines a format of response:
rawResponseparameter can be set to false for Select only queries, e.g.,SELECT * FROM mytable.rawResponseparameter can be set to true for any type of query (including Select qieries as well) , e.g.,SHOW TABLES. The query string must stay as it is, no URL encoding is needed.
The response object depends on the query executed. In select mode the response has same format as/searchoperation.
// Import classes:
import com.manticoresearch.client.ApiClient;
import com.manticoresearch.client.ApiException;
import com.manticoresearch.client.Configuration;
import com.manticoresearch.client.model.*;
import com.manticoresearch.client.api.UtilsApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("http://127.0.0.1:9308");
UtilsApi utilsApi = new UtilsApi(defaultClient);
try {
Object sqlresult = utilsApi.sql("SHOW TABLES");
System.out.println(sqlresult);
} catch (ApiException e) {
System.err.println("Exception when calling UtilsApi#sql");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}| Name | Type | Description | Notes |
|---|---|---|---|
| body | String | A query string. | |
| rawResponse | Boolean | Defines a format of response. Can be set to false for Select only queries or set to true for any queries (including Select queries). |
Map<String, Array>
No authorization required
- Content-Type: text/plain
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | In case of SELECT-only in mode none the response schema is the same as of `search`. In case of `mode=raw` the response depends on the query executed. | - |
| 0 | error | - |