DB Engine | Qntrl | Bridge | Online Help | Execute SQL query in a database

DB Engine

DB Engine is used to connect with the database in the client's machine or client's network and perform READ/INSERT/UPDATE operations in the database. The DB Engine configured in Bridge can be utilized in the following two distinct modules within Qntrl.

  1. DB Lookup fieldEstablishes a connection with the customer's database, executes queries, and presents the response in a dropdown or multi-select field within Qntrl. Check DB Lookup for more details.
  2. Circuit - In the Circuit workflow, DB Engine states to establish a connection with the client's database executes the defined query, and performs a task. Check DB Task for more details. 


Prerequisite
While creating Credentials for DB Engine, choose the credential type as JDBCClick here to learn how to create a credential.

Request data  
{
  "task_name": "db_task",
  "credential": {
"name": "<CREDENTIAL_NAME>"
},
"task_details": {
"database": "<DATABASE_NAME>",
  "db_query": "<SELECT NAME FROM <table>>",
  "port": 3306,
  "query_timeout": 10000,
  "host": "<HOST_NAME>",
  "sql_type": 1   
  }
 }


Where,
Keys
Description

 task_name

 

  A system-defined name for the respective module.
  1.     'db_task' - task name for SELECT operations.
  2.     'db_dml_task' - task name for INSERT/UPDATE operations
 credential  A JSON object that contains details of the JDBC credential.
 name  Name of the DB credential.
 task_details  A JSON object that contains details of the DB task.
 database  Name of the client database.
 db_query  DB query to be executed (SELECT/INSERT/UPDATE).
 portThe port used by the DB, by default, MySQL runs in port 3306, SQL Server in 1433, and PostgreSQL in 5432. If your database runs on a different port number, update this field accordingly.
 query_timeout
 (optional)
 Time to wait for an SQL request to complete.
 host Host name of the machine in which DB resides.
 sql_type The database used. For MySQL - 1, for Oracle - 2, for SQLServer - 3, for PostgreSQL - 4
 allow_multiple_columns
 (optional)
  Specifies the columns in SQL Query to be considered for data retrieval.   
  1. 'true' - retrieves the data of all the columns listed in the SQL query
  2. 'false' - retrieves only the values of the first column in the Select column list of SQL query
  If not specified it takes the default value as 'false'.