All URIs are relative to http://127.0.0.1:9308
Method | HTTP request | Description |
---|---|---|
sql | POST /sql | Perform SQL requests |
Map<String, Object> sql(body)
Perform SQL requests
Run a query in SQL format. Expects a query parameters string that can be in two modes:
- Select only query as
query=SELECT * FROM myindex
. The query string MUST be URL encoded - any type of query in format
mode=raw&query=SHOW TABLES
. The string must be as is (no URL encoding) andmode
must be first. The response object depends on the query executed. In select mode the response has same format as/search
operation.
// 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("mode=raw&query=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 | Expects is a query parameters string that can be in two modes: * Select only query as `query=SELECT * FROM myindex`. The query string MUST be URL encoded * any type of query in format `mode=raw&query=SHOW TABLES`. The string must be as is (no URL encoding) and `mode` must be first. |
Map<String, Object>
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 | - |