Read Database
Summary
Reads data from a MySQL or PostgreSQL database. Provide connection details and a query to get data.
Properties
The following table lists the Read Database block properties and describes the input for each property.
Property | Description |
---|---|
Host | The database host name (the location of the server) |
Port | The port number on which the database communicates |
Database Name | The name of the database instance |
User | The username to connect with |
Password | The password for the username to connect with |
Database Vendor | The database vendor — MySQL or PostgreSQL |
Parameters | Database-vendor specific key-value parameters (optional). For example, maxRows 5 limits the maximum number of returned rows to 5 (MySQL-specific) |
Query | The SQL query to send. For example, if the input parameter name is "query", enter ${@query[0]}, which means that the SQL query to use is located at the 0th row of the input-parameter frame |
Sample MySQL settings
Property | Value |
---|---|
Host | mysql-db.example.com |
Port | 3306 |
Database Name | employees |
User | root |
Password | password |
Database Vendor | mysql |
Parameters | key: maxRows value: 5 |
Query | select * from employees where employee_id=${@id[0]} |
Sample PostgreSQL settings
Property | Value |
---|---|
Host | postgresql-db.example.com |
Port | 5432 |
Database Name | employees |
User | john |
Password | postgres |
Database Vendor | postgresql |
Parameters | key: connectTimeout value: 5 |
Query | SELECT * FROM employees WHERE employee_id=${@id[0]} |