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

DB Engine

This state enables a connection with the database hosted on a private or local network and executes the defined SQL query in the database.

Prerequisite
  • An active Bridge agent. Refer here to install and configure Bridge.

  • Create the necessary Credentials for the applications to be connected by DB Engine.

  • For more details about the DB Engine module in Bridge, the keys, and its description, click here.


Use Case Example: In the employee onboarding process, once the recruitment is complete, the HR department updates the database with the newly recruited employee's information. DB state is employed to feed the system with these employee details. By executing a DB query, you can create an entry in the organization's legacy database, thereby recording the employee's information. Additionally, DB state enables HR to retrieve the details of any required employees.

Builder View

For associating a DB Task with a circuit:
  1. In Builder View, drag and drop the DB Engine state from the left pane into your circuit, or click the required DB Engine state in your circuit.

  2. Under the Configuration tab, update the common state field attributes.

  3. The Bridge ID field should capture the details of the bridge to be used for this task. Select the required bridge from the drop-down list.  

  4. Under Add Configuration, in the Credential Name field, select the credential from the dropdown list. The Credential IDs of all the credentials created for the DB Engine module type will be displayed in the list.

  5. Under Query Message, fill in the following fields:

    • Database - Enter the name of the connecting database in which the query has to be executed.

    • Query - Enter the query that has to be executed in the database.

    • Port - Enter the port in which the MySQL server is running. The default port is 3306.

    • Query Timeout - Specify the time limit (in seconds) within which the query must be executed.

    • Host - Enter the hostname of the machine in which the database query has to be executed. Enter the hostname as localhost, if the query is executed on the same Bridge-installed machine.

    • Database Type - Select the database type from the dropdown list.

    • Connection Timeout - Specify the time limit (in seconds) within which the connection to the specified server must be made.

  6. For error handling, you have the option to choose and configure error handling settings. To learn more, check Error Handling in Circuit states.
  7. In the Input / Output section, fill in the required paths. Learn more about I/O paths.       

      


Code view

In Code View, the JSON to configure the DB Engine state to pass a query and retrieve data from a database table is given below:

"Add User in Legacy Database": {
   "type": "db_engine",
   "next": "End",
   "bridge_id": "bridge-employee onboarding",
   "payload": {
      "credential_id": "db_cred_2",
      "query": "INSERT INTO user_record values('John Mathew','john.mathew@zylkermail.com','New York');",
     "query_timeout": 100,
      "host": "localhost",
      "database_type": "MySQL",
      "connection_timeout": 100,
     "port": 3306,
   "database_name": "user_db"
   }
}




NextSSH Engine

    • Related Articles

    • 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 ...
    • Bridge agent settings

      Once the Bridge agent is set up, you can log in to the bridge agent to view and modify the allowed configuration as needed. To do this: In Qntrl, navigate to (settings) >> Advanced >> Bridge, then select your bridge. Hover your cursor over the bridge ...
    • Credentials

      The Credential module provides a streamlined solution for storing and managing authentication credentials for databases, remote machines, and application servers. Organizations dealing with multiple databases or APIs often face repetitive credential ...
    • Task Engine

      Circuit's Task Engine state is used to connect with other applications and access APIs from a closed space. To retrieve data from a private network, the required API must be accessed from the local machine's network for the required conditions. ...
    • Install Bridge

      Follow the below step-by-step procedures to configure and use Bridge in Qntrl. Step 1: Download the Bridge agent Only one Bridge agent can be installed per machine. To download a bridge agent in Qntrl: Navigate to (settings), under Advanced click ...

    You are currently viewing the help articles of Qntrl 3.0. If you are still using our older version and require guidance with it, Click here.