Wings Engine

Connect PostgreSQL

In the section on how to add a data source, we have already outlined the steps for adding a data source. This article will focus on the specific settings for the PostgreSQL data source.

1.Connect Database

In the Data Source Edit window, select the “Add New Data” tab on the left, and then click the “PgSQL Database” checkbox in the database category on the right.

2. Set Parameters

The software will display a “Connect to PgSQL” settings dialog. Enter the required basic parameters for the database and click the “Connect” button. The software will automatically attempt to connect to the database and retrieve all the databases within it.

3. View Data Source

There are two modes for adding data: “Table/View” mode and “SQL” mode.

3.1 Table/View Mode

After clicking the “Connect” button, in “Table/View” mode, select the database name where the tables you want to add are located. The software will list all the table names in that database in the box on the right side of the database list. Select the tables you want to add and click “OK”

The software will automatically load the data from the tables and display it on the interface. If everything is correct, click the “OK” button, and the PostgreSQL data source will be successfully added.

3.2 SQL Mode

When connecting to a database, if you need to perform operations such as joining tables, filtering fields, filtering by quantity, or sorting, you can use SQL statements to achieve this. However, the SQL functionality is mainly intended for use by developers or individuals with some SQL knowledge.

For example: If we have added a test database and want to filter the name and age fields from the student table in the test database, you only need to add an SQL statement to perform the field filtering. Here are the specific steps:

After clicking the “Connect” button, in “SQL” mode, click “+ Add SQL Statement”, enter the SQL statement “SELECT name, age FROM student” and then click “OK” to perform the data filtering operation.

At this point, the software will automatically load the data from the table and display it on the interface. Once you confirm that everything is correct, click the “OK” button to successfully add the PgSQL data source.

**[Friendly Reminder] **The data here is for viewing only and cannot be modified online. If you need to modify the data, please make the changes directly in the database. After making the changes, please follow the tutorial to refresh the data.