Skip to main content

Databases

Databases play a crucial role in numerous applications, serving as the backbone for storing and managing data. With DronaHQ, you have the capability to execute queries for data retrieval and modification directly from its intuitive editor.

Connecting a Database

Here you will learn how to connect to a database on DronaHQ.

  1. Click on Connectors from the sidebar.
  2. You will see, on top right there is a + Connector button, click on it.
  3. From the list, select the database you need to connect to. This opens the page where you can configure the parameters to connect to your database.
List of available databases connectors.
List of Databases
  1. Give a name to the configuring database, to identify it later on.

  2. Fill up the required details and parameters to configure your database on DronaHQ successfully. DronaHQ encrypts all your data and store them securely.

  3. Click the Test button and test the connection. Ensure that the database is valid.

  4. Click Save to create and save the database connection.

tip

We offer AI-powered suggestions in the test connection phase for all database connectors.
This support is helpful when encountering errors during configuration and testing, aiding in understanding errors and presenting common troubleshooting causes for easier resolution.

AI providing error information and cause while configuring MySQL database connector.
AI providing information and cause on the error faced during MySQL database connector configuration.

Writing Queries

The information you want to present in any application is spread across multiple tables in a database. Queries play a vital role in collecting data from different tables and consolidating it for display.

With queries, you can perform various operations such as data insertion, updating, or removal from the database. Furthermore, queries enable data binding to widgets and offer additional functionalities that enhance the overall performance and user experience of the application.

This section talks about the steps to create a database query in the query editor:

  1. Once you are done with configuring database connector. It will show in the connectors' list. Click on the Add Query button.
Add Query
Click on ADD QUERY to open query editor.
  1. The query editor will open. You need to provide a name for the query and then write MySQL queries (Since here MySQL database is taken as an example.) underWrite Your Query.
Query Builder
MySQL Query builder with schemas on display.
DronaHQ provides specialized query editors for different databases, such as MySQL and MongoDB. These

database-dependent query editors enable users to write queries that are optimized for specific database systems, ensuring efficient and precise data manipulation. :::

effortlessly using natural language prompts. This exceptional functionality allows users to generate database queries with ease, making the process much faster and more user-friendly. :::

  1. Write a query, let's say to fetch all the details from a table in the database. After that, click Test Quey.
Query Response
Query response.
  1. Click Save and your query will be added to the database connector.
Query added to the database connector.
Query added to the database connector.

Making Queries Dynamic

In the realm of database connections, the key factor lies in the manner in which we execute queries.

In certain situations, such as when retrieving order details for products in a shop, there may be a need to obtain specific details for different products each time. To achieve this, dynamic inputs can be utilized. By incorporating dynamic parameters into the query, it becomes possible to fetch data from the data source based on the specific product details desired. This approach allows for flexibility and enables the retrieval of product details by passing dynamic parameters whenever required.

In DronaHQ's Query Builder, it is possible to accomplish this by creating variables using {{ }} notation when adding a query to a configured datasource connector, (It can be database or API connector). These variables can then be utilized to pass dynamic parameters to queries through various methods, such as forms, data, user-input, and more, within the App.

Let's see how to pass parameters to database query:

For Example, suppose we need to retrieve data from a table based on a particular order ID. However, we want this order ID to be dynamic and passed as a parameter to the query of the database connector.

List of available databases connectors.
The keyword of `text input control` is used to provide user input as query parameters.

As shown in the image above, the orderid has been transformed into a dynamic variable. Consequently, you can conveniently provide parameter values from the app by utilizing keywords.

List of available databases connectors.
The keyword of `text input control` is used to provide user input as query parameters.