{dbupdate}
Settings
Setting Name Type Description autoaddfields yes/no If yesm when you pass a field name that does not exist in the table, a field will automatically be created. If no, an error will be shown when the field does not exist. General Data Blaze Setting _ query The BSQL query to run. (Syntax Docs) space Space ID The ID of the space you want to run the query on. completed function Function called when the request completes. The function takes the results of the request and returns a string. If the returned string is not blank (""), creates a browser notification with that message. retry keyed list Retry automatically if the request fails. General Command Settings trim yes/no/left/right If yes whitespace is removed before and after the command. If left, only whitespace to the left is removed. If right, only whitespace to the right is removed.
| Setting Name | Type | Description |
|---|---|---|
| autoaddfields | yes/no | If yesm when you pass a field name that does not exist in the table, a field will automatically be created. If no, an error will be shown when the field does not exist. |
| General Data Blaze Setting | ||
| _ | query | The BSQL query to run. (Syntax Docs) |
| space | Space ID | The ID of the space you want to run the query on. |
| completed | function | Function called when the request completes. The function takes the results of the request and returns a string. If the returned string is not blank (""), creates a browser notification with that message. |
| retry | keyed list | Retry automatically if the request fails. |
| General Command Settings | ||
| trim | yes/no/left/right | If yes whitespace is removed before and after the command. If left, only whitespace to the left is removed. If right, only whitespace to the right is removed. |
Learn more about Data Blaze here.
Learn more about Update queries here.
Retrying requests
You can use the retry setting to automatically retry the request if it fails. It takes a keyed list with delays (a list of millisecond delays) and when (a list of conditions).
Supported condition types: connection (for network errors) and timeout (for query timeouts).
For example, the following command will retry after 2 seconds, and then 4 seconds on a connection error or a query timeout:
{dbupdate: ...; retry=["delays": [2000, 4000], "when": [["type": "connection"], ["type": "timeout"]]]}
Note: If the request is not idempotent, it is possible for duplicate actions to be caused due to retrying. For example, if the initial request was successfully received and acted on by the server, but the confirmation never made it back to Text Blaze.