Configuring a database connection
Last updated
Last updated
This is preview documentation for functionality that will be introduced in our next scheduled release. Information on this page is subject to change until this time.
To configure a database connection, add a connector shape to your process flow in the normal way and select the required source instance
and source query
for an existing database connector:
Having selected a source instance
, you'll know if you're working with a database connector because the subsequent field requires you to choose a source query
rather than a source endpoint
.
Generally, database connector settings work on the same principles as 'normal' connectors but there are differences, depending on whether you're using a query that receives or sends data.
When a connector shape is configured with a receive
type query (i.e. you're receiving data from a database), you'll see settings sections for variables
, error handling
, and response handling
:
These options are summarised below.
Variables
Custom
Any query variables defined for the selected query are displayed here. Variables may be mandatory (denoted with an asterisk) so a value must be present at runtime, or optional.
Error handling
Retries
Sets the number of retries that will be attempted if a connection can't be made. You can define a value between 0
and 2
. The default setting is 1
.
Response handling
Save response in payload
Set this option to on
to save the response from the completed operation IN the payload for subsequent processing.
This option provides the ability to access the response body via payload parameters.
By default, the response is saved in a field named response
however, when the save response in payload
option is toggled on
, you can specify your preferred field name.
When a process flow runs using a receive
type query, received data is returned in a payload. You can view this data in logs - for example:
The number of payloads received is determined by pagination options defined in the query setup, and whether these options are referenced in the associated query.
When a connector shape is configured with a send
type query (i.e. you're sending data to a database), you'll see settings sections for variables
, database
, error handling
, and response handling
:
These options are summarised below.
Variables
Custom
Any query variables defined for the selected query are displayed here. Variables may be mandatory (denoted with an asterisk) so a value must be present at runtime, or optional.
Database
Override query
You can enter your own database query here which will be run instead of the source query already selected.
Before using an override query you should ensure that:
target columns exist in the database
target columns are configured (in the database) to accept null
values.
Items path
If your incoming payload contains a single array of items, enter the field name here. In doing so, the process flow loops through each item in the array and performs multiple inserts as one operation.
For more information please see About item paths.
Error handling
Retries
Sets the number of retries that will be attempted if a connection can't be made. You can define a value between 0
and 2
. The default setting is 1
.
Response handling
Save response as payload
Set this option to on
to save the response from the completed operation as a payload for subsequent processing.
Save response in payload
Set this option to on
to save the response from the completed operation IN the payload for subsequent processing.
This option saves the response from your database, together with the payload that was sent in.
By default, the response is saved in a field named response
however, when the save response in payload
option is toggled on
, you can specify your preferred field name.
The items path
field is used to run the associated query for multiple items (i.e. database rows) in a single operation, by looping through all items in a given array:
Here, specify the field name in your payload associated with the array to be targeted.
The items path
field can't be used to target individual payload items. For this, you'd need an alternative approach - for example, you might choose to override query
and provide a more specific query to target the required item.
When a process flow runs using a send
type query, the default behaviour is for the response from your database to be returned as the payload. You can view this in logs - for example:
If you want to see the data that was passed in, toggle the save response in payload option to on
.