Skip to main content

Posting data to a third party endpoint

Should you wish to monitor the execution of a query and receive updates via an external application, you can set up an automatic message to be sent out. For instance, imagine you want to receive a notification each time a specific query fails to execute. In our example, we will send a message to a slack channel as our third party application and intentionally use the incorrect table name 'custmers' instead of 'customers' in the code to ensure the query fails.

Select
*
From
custmers
ON ERROR
POST '
{
"text": "FAILED",
"channel": "Kvery-Demo"
}
'
TO 'https://hooks.slack.com/services/yourslackid'
ON ERROR RETURN 'ERROR'
Name

By doing this, we receive not only an error message within Kvery but also a notification posted directly to our Slack channel.

Name

We can use the same system for a successful run as well. In that case just use the following function.

ON SUCCESS POST '' TO ''