Database

The Database Function helps the user to forward, delete or update data from your stream to a database. This is a Forwarder Function and can be used to create and update audit records in a database.

Configure the Database forwarder Function by entering the required credentials in the following sections: 

  1. Database Configuration
  2. Authentication
  3. SQL Statement

Database Configuration

The information required to access the database.

FieldDescription
Database Type

Select the type of database that you want to push your data to. The available options are:

  • MySQL
  • PostgreSQL
  • Microsoft SQL
Database NameSpecify the name of the database you want to push the data to.
Hostname or IP AddressSpecify the hostname or the IP Address of the database.
Port

Specify the port used by the database. When a Database Type is selected, the default port number is specified for each type of database.

The default port numbers are:

  • MySQL: 3306
  • PostgreSQL: 5432
  • Microsoft SQL: 1433

Authentication

The authentication information to log in to the database.

FieldDescription
UsernameSpecify the username for the authentication.
PasswordSpecify the password for the authentication.

SQL Statement

Specify the statement that you can use to push data to the selected database. 

Example using INSERT INTO
INSERT INTO table_name (column1, column2, column3, ...)
VALUES (value1, value2, value3, ...);
Example using UPDATE
UPDATE table_name
SET column1 = value1, column2 = value2, ...
WHERE condition;
Example using DELETE
DELETE FROM table_name WHERE condition;

Note!

The Database function supports Variable Insertion when writing SQL statements. 

Example for Interpolation
DELETE FROM table_name WHERE id = ${id} AND name = ${name};