Skip to main content
Version: 4.62

executeSQL

Executes an SQL command in the local database.

Field Configurations​

KeyTypeDescriptionDefault Value
"params" (required)Objectundefinednull

Parameters​

KeyTypeDescriptionDefault Value
"async"BooleanSpecifies whether the action should perform asynchronously.null
"onError"StringEvent that is fired of case of an error.null
"onErrorType"OnErrorTypeType of event that will be fired on error.null
"onSuccess"StringEvent that is fired in case of success.null
"onSuccessType"OnSuccessTypeType of event that will be fired on success.null
"sql" (required)StringThe SQL commad that is to be executed.null
"sqlParams"ArrayThe parameters for the SQL command.null

Inherited​

From Base Action

Base Action

Field Configurations

KeyTypeDescriptionDefault Value
"dynamicParams"ObjectDynamic params to retrieve data from a specific context e.g. a userSetting.null
"leadingDelimiter"StringThe leading mustache delimiter to use.null
"params"Object,ArrayObject containing the properties of the action.null
"trailingDelimiter"StringThe trailing mustache delimiter to use.null
"type"StringType name of the action.null

Examples​

Example 1: Execute an SQL command​

Show ExampleHide Example

Execute the SQL command specified in the sql key using the specified sqlParams.

{
"type": "executeSQL",
"params": {
"sql": "REPLACE INTO _settings (key, string, int, real) VALUES ('testValue', ?, NULL, NULL);",
"sqlParams": [
"executeSQL test value"
],
"onSuccess": "replaceSuccess",
"onError": "replaceError"
}
}