MySQL
MySQL is a powerful open-source relational database management system known for its speed, reliability, and flexibility, making it a popular choice for various applications and data-driven projects.
Configuring Connector
Prerequisites
Authentication Credentials: Obtain the required credentials to connect to your MySQL instance. Choose from the following options:
- MySQL database username and password.
- AWS IAM authentication (for AWS-hosted MySQL databases).
Connection Details:
- Hostname of the MySQL database.
- Port number for database access.
- Database name within the MySQL host.
Firewall Rules:
- Set up firewall settings to allow DronaHQ (IP whitelist) access to your MySQL host.
Ensuring these prerequisites are in place will ensure a seamless integration of MySQL with DronaHQ, facilitating effective data management and utilization.
Connector Setup in DronaHQ
Configure your database category by providing the details below. Choose between User and Password
or AWS IAM
Authentication. Validate the connection using Test connection
and Save
settings for a secure and efficient database
setup.
DronaHQ can Auto fill crucial connection values like host, name, password, and more from the connector's connection string or from a AWS IAM credentials using AWS Import.
General
Field | Description |
---|---|
Host | Enter the Host Domain or IP |
Port | Enter the Port number |
Database Name | Enter the Database name |
Authentication Type | Choose from User and Password or AWS IAM |
Username | Enter the Username |
Password | Enter the Password |
AWS Access Key | Enter the AWS Access Key of your database. |
AWS Secret Key | Enter the AWS Secret Key of your database. |
AWS Region | Enter the AWS Region of your database. |
Role to assume (ARN) | Enter the role to be used while accessing API. Example - arn:aws:iam::123456789012:role/RoleName |
|
Admin
Advanced Option | Description |
---|---|
Connection Options | The key and value connection options in MySQL configuration refer to specific settings (keys) and their corresponding values that dictate how the application connects to the database |
Use Dynamic Database Host | Dynamically determine the host for the database connection. |
Use Dynamic Database Name | Set the database name dynamically, allowing easy switching between databases. |
Use Dynamic Database Credentials | Enable dynamic database credentials for secure and convenient management. |
Enable Converting Queries to Prepared Statement | Opt for prepared statements to enhance database performance and security. |
Connect using SSL | Securely access the database using an encrypted SSL connection, ensuring data integrity and confidentiality. |
Enable SSH Tunneling | Securely access the database through encrypted SSH tunneling. |
Whitelist IP | Enhance security by restricting database access to specific whitelisted IP addresses. |
Adding Database Queries
Once the connector is configured, access it in your Connector Library. Click Add query
after connection setup. Create
queries, run them, and view responses.
Use double curly brackets for dynamic variables. Test with sample values before saving. Link dynamic variables to controls/actions for runtime use.
Saved queries appear under your connector in Connector Library.
Supported Query Operations
Operations | Description |
---|---|
Raw SQL Query | Various select, insert, delete, update , join operations. |
Stored Procedure Call | Call stored procedures e.g., CALL getUserInfo; |
Using MySQL Connector
Data Bind using Data Query
Read/Display Data Query for MySQL:
Start by constructing an SQL query to extract data from your MySQL database. For instance, let's consider an example
where you want to retrieve data from the Authors
table based on specific initials. The SQL query is:
Query used:
SELECT * FROM Authors WHERE initials = "{{SearchInitials}}";
Query explanation:
This SQL query retrieves all rows and columns from the Authors
table where the initials match the value provided
through the dynamic variable {{SearchInitials}}
.
Integrate the fetched data into your application's interface.
a. Access the Controls section and introduce the Table grid control.
b. Navigate to Data Bind Options -> Quick Select -> Database Queries
.
c. Opt for the MySQL connector and choose the query that aligns with your data presentation goals.
By following these steps, you can seamlessly retrieve and display data from the Authors
table based on specific
initials using the MySQL Connector, enhancing your application's functionality and user experience.