SQL DB connector
Component for creating connections, sending queries, and manipulating data in an SQL database.
In-ports
connection String
— database connection string.
query String
— SQL query.
query-params JSON
— specifies values for the template parameters in the query that correspond with key-value pairs it receives.
trigger <any>
— triggers a query to the database. If the port is not connected, the query is made on event to connection and query port.
abort Boolean
— aborts all pending queries.
Out-ports
response JSON, Signal
— emits a response wrapped into a JSON object, or an error signal, in case the query failed.
error JSON
— if an error occurs, emits a JSON object with the query details and an error cause.
Overview
SQL DB component enables you to access databases through JDBC. At minimum, you will need to provide a database connection string and a query itself to the connection and query ports respectively. If it is necessary to authenticate, specify which database to use and add credentials with the Authentication setting.
SQL DB component employs the internal Data Gateway service to create a secure channel to interact with a database. To keep your credentials safe they are stored encrypted in a vault that only this service has access to. The request does not contain any actual credentials but contain a reference to credentials stored in the vault. This ensures that credentials cannot be retrieved from within the app or intercepted during the transfer process.
When the data is received the component wraps it into a JSON object and emits on the response port.
Connection string format
The format of the database connection string depends on the database you are using. For connection string formats and examples for the most popular databases, see SQL DB Connection Strings.
Settings
Authentication
Configure authentication to the target database. Select one of the existing connections from the drop-down list, or configure a new connection. You may also leave the default “No Auth” setting if the database does not require authentication.
ⓘ NOTE
Database credentials can be passed as connection string parameters. However, the credentials passed this way may be intercepted during the transfer process and be seen by workspace members who can edit this app.
Timeout
Sets the request timeout in milliseconds. The request is aborted if the response is not returned within the timeout. A value of 0
indicates no timeout value, which is also the default.
Keep always active
Forces the component to make a request in advance, before the data is needed by the component down the graph. By default, the request is made at the time when data is needed by the component. For example, when a widget comes into a view of the user. The default value is no
.