executeSQL
Executes an SQL command in the local database.
Field Configurations
Key | Type | Description | Default Value |
---|---|---|---|
"params" (required) | Object | undefined | null |
Parameters
Key | Type | Description | Default Value |
---|---|---|---|
"async" | Boolean | Specifies whether the action should perform asynchronously. | null |
"onError" | String | Event that is fired of case of an error. | null |
"onErrorType" | OnErrorType | Type of event that will be fired on error. | null |
"onSuccess" | String | Event that is fired in case of success. | null |
"onSuccessType" | OnSuccessType | Type of event that will be fired on success. | null |
"sql" (required) | String | The SQL commad that is to be executed. | null |
"sqlParams" | Array | The parameters for the SQL command. | null |
Inherited
From Base Action
Base Action
Field Configurations
Key | Type | Description | Default Value |
---|---|---|---|
"dynamicParams" | Object | Dynamic params to retrieve data from a specific context e.g. a userSetting. | null |
"leadingDelimiter" | String | The leading mustache delimiter to use. | null |
"params" | Object,Array | Object containing the properties of the action. | null |
"trailingDelimiter" | String | The trailing mustache delimiter to use. | null |
"type" | String | Type name of the action. | null |
Examples
Example 1: Execute an SQL command
Goal: Create an executeSQL action
To achieve this the following code can be used:
{
"type": "executeSQL",
"params": {
"sql": "REPLACE INTO _settings (key, string, int, real) VALUES ('testValue', ?, NULL, NULL);",
"sqlParams": [
"the new value"
],
"onSuccess": "successEvent",
"onError": "errorEvent"
}
}
The sql
and sqlParams
parameters specify the SQL command.
Result:
An executeSQL action has been created.