execute_sql
- execute_sql(
statement: string,
offset?: number,
limit?: number,
request_schema_str?: string,
data?: string[],
options?: Record<string, string>,
callback?: GPUdbCallback,
): Promise<ExecuteSqlResponse>Parameters
- statement: string
SQL statement (query, DML, or DDL) to be executed.
Optionaloffset: numberA positive integer indicating the number of initial results to skip (this can be useful for paging through the results).
Optionallimit: numberA positive integer indicating the maximum number of results to be returned, or END_OF_SET (-9999) to indicate that the maximum number of results allowed by the server should be returned. The number of records returned will never exceed the server’s own limit, defined by the max_get_records_size parameter in the server configuration. Use
has_more_recordsto see if more records exist in the result to be fetched, andoffsetandlimitto request subsequent pages of results.Optionalrequest_schema_str: stringAvro schema of
data.Optionaldata: string[]An array of binary-encoded data for the records to be binded to the SQL query. Or use query_parameters to pass the data in JSON format.
Optionaloptions: Record<string, string>Optional parameters.
Optionalcallback: GPUdbCallbackOptional callback function
Returns Promise<ExecuteSqlResponse>
Promise<Types.ExecuteSqlResponse> - Promise resolving to the response
- Defined in src/GPUdb.ts:8620
- statement: string
execute_sql_request
- execute_sql_request(
request: ExecuteSqlRequest,
callback?: GPUdbCallback,
): Promise<ExecuteSqlResponse>Execute a SQL statement (query, DML, or DDL).
See SQL Support for the complete set of supported SQL commands.
When a caller wants all the results from a large query (e.g., more than max_get_records_size records), they can make multiple calls to this endpoint using the
offsetandlimitparameters to page through the results. Normally, this will execute thestatementquery each time. To avoid re-executing the query each time and to keep the results in the same order, the caller should specify a paging_table name to hold the results of the query between calls and specify the paging_table on subsequent calls. When this is done, the caller should clear the paging table and any other tables in the result_table_list (both returned in the response) when they are done paging through the results.paging_table(and result_table_list) will be empty if no paging table was created (e.g., when all the query results were returned in the first call).Parameters
- request: ExecuteSqlRequest
Request object containing the parameters for the operation
Optionalcallback: GPUdbCallbackOptional callback function
Returns Promise<ExecuteSqlResponse>
Promise<Types.ExecuteSqlResponse> - Promise resolving to the response
- Defined in src/GPUdb.ts:8561
- request: ExecuteSqlRequest
Execute a SQL statement (query, DML, or DDL).
See SQL Support for the complete set of supported SQL commands.
When a caller wants all the results from a large query (e.g., more than max_get_records_size records), they can make multiple calls to this endpoint using the
offsetandlimitparameters to page through the results. Normally, this will execute thestatementquery each time. To avoid re-executing the query each time and to keep the results in the same order, the caller should specify a paging_table name to hold the results of the query between calls and specify the paging_table on subsequent calls. When this is done, the caller should clear the paging table and any other tables in the result_table_list (both returned in the response) when they are done paging through the results.paging_table(and result_table_list) will be empty if no paging table was created (e.g., when all the query results were returned in the first call).