Database Actions

Modified on Fri, 20 Sep at 2:32 PM

TABLE OF CONTENTS

1. Overview

1.2 Database Keywords 

2. Related Topics

1. Overview

This article describes about various database actions used, and their functionalities in algoQA. 

1.2 Database Keywords 

      The following table describes database actions used in algoQA and the description: 

Keyword Description 
Custom-specific parameter for PostgreSqlRetrieve data from Postgresql  database and verify it using parameterized query.
For example, consider a scenario where you have a table called employees, and you want to fetch all records where the department is "Sales." Your query would look like this:

you can pass the parameter in the following format during the Node Configuration: PostgreSql_#Query1:-SELECT * FROM employees WHERE department = 'Sales';.
For more information, refer to Adding a Parameter in the Node Configuration.
get data from db and verify

Retrieve data from a database and verify it using a parameterized query
For example, consider a scenario for verifying the user details from database and check that user information is correctly stored in the database.

  • Accessing the Database: Ensure we have a secure connection to our database system.
  • Executing the Query: Search for specific user details using their username.
  • Verification: Confirm that the user's details, such as their username, email address, and role, match what we expect.

you can pass the parameter in the following format during the Node Configuration: <database>_#Query1:-<add your query>. In this, replace <add your query> with your actual query statement.

get data from db and verify in mongodbRetrieve data from Mongo database and verify it using a parameterized query
Use the same preceding example except that you would be verifying user details from mongo database and check the user information stored in mongo database.

you can pass the parameter in the following format during the Node Configuration: Mongodb_#Query1:-<add your query>. In this, replace <add your query> with your actual query statement.

verify db data in sqlVerifies the data in a database involves running SQL queries to check for the existence of certain data.
For example, check if there are any users whose status is 'active' using the following SQL query:
SELECT *FROM users WHERE status = 'active';
use this query to verify the presence of active users in the users table. If the query returns any rows, it confirms that there are active users. This type of verification is useful in scenarios where you need to ensure certain conditions are met or to gather specific information from your database.

You can pass the parameter in the following format during the Node Configuration: Sql_#Query1:-<add your query>. In this, replace <add your query> with your actual query statement.
update db data in sqlUpdating data in a SQL database involves modifying existing records based on certain conditions or criteria.

For example: Updating Product Price in SQL Database

Consider a table named products with columns product_ID, product_name, category, and price. Let's update the price for a product with product_ID = 123.

you can pass the parameter in the following format during the Node Configuration: Sql_#Query1:-<add your query>. In this, replace <add your query> with your actual query statement.
get date from db and verify datetime (staging)

Retrieve and verify datetime values from a database, you can execute a query that fetches the relevant records and checks if the retrieved dates meet certain criteria. 


For example, consider a scenario for retrieving user registration dates from a database and verify if they are within the last 30 days.


Assume that you have a table called users with a column registration_date, your query might look like this:

SELECT * FROM users

WHERE registration_date >= NOW() - INTERVAL '30 days';


You can pass the parameter in the following format during the Node Configuration:

Sql_#Query1:-SELECT * FROM users WHERE registration_date >= NOW() - INTERVAL '30 days';

verify db data in mysql

Verifies database data in MySQL, execute queries to check for specific conditions. 


For example, consider a scenario to verify if there are any users whose status is "active."


To check for active users in a table called users, your query might look like this:
SELECT * FROM users

WHERE status = 'active';


You can pass the parameter in the following format during the Node Configuration:

MySQL_#Query1:-SELECT * FROM users WHERE status = 'active';

copied db data in sql

Involves copying specific data from one table to another within a SQL database. The query selects particular columns from a source table and inserts them into a target table, which is useful for reporting or data migration purposes.


For example, consider a Table1 containing customer information, and you want to copy specific columns into Table2.

To copy customer_name, email, and phone_number, you can execute:


INSERT INTO Table2 (customer_name, email, phone_number)

SELECT customer_name, email, phone_number

FROM Table1;


You can pass the parameter in the following format during the Node Configuration:

Sql_#Query1:-INSERT INTO Table2 (customer_name, email, phone_number) SELECT customer_name, email, phone_number FROM Table1.

To add, modify or update a UI element, refer to article Adding or Modifying Default actions.



Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article