"parameter": {"datasource": "abc","column": ["id","\\"123Test\\"", //Adding escape characters],"where": "","splitPk": "id","table": "public.wpw_test"}
Parameters | Description |
Data Source | Available PostgreSQL data source. |
Database | Supports selecting or manually entering the database name to be read By default, the database bound to the data source is used as the default database. Other databases need to be manually entered. If the data source network is not connected and the database information cannot be fetched directly, you can manually enter the database name. Data synchronization can still be performed when the DataInLong network is connected. |
Schema | Supports selection or manual input of the Schema name to be read. |
Table | Supports selecting or manually entering the table name to be read In the case of partitioned tables, you can select or enter multiple table names on the PostgreSQL source side. Multiple tables must have consistent structures. In the case of table partitioning, the table index range can be configured. For instance, 'table_[0-99]' indicates reading 'table_0', 'table_1', 'table_2' up to 'table_99'; if the numeric suffix of your tables has a consistent length, like 'table_000','table_001','table_002' up to 'table_999', you can configure it as '"table": ["table_00[0-9]", "table_0[10-99]", "table_[100-999]"]'. If the data source network is not connected and the table information cannot be fetched directly, you can manually enter the table name. Data synchronization can still be performed when the DataInLong network is connected. |
Add Sharded Database/Table | Suitable for multi-database scenarios, click to configure multiple data sources, libraries, and table information. Note:
When selecting multiple table objects in a multi-database, multi-table scenario, the Schema information (including field names and field types) must be consistent. The system defaults to displaying the metadata field information of the first table of the first data source within the data fields module. If fields differ among tables, it may cause runtime failures. |
Split Key | You can use a certain column in the source data table as the partition key; it is recommended to use a primary key or an indexed column as the partition key. Only fields of type integer are supported. During data reading, data sharding is performed based on the configured field, enabling concurrent reading and improving data synchronization efficiency. |
Filter Conditions (Optional) | PostgreSQL concatenates the SQL based on the specified WHERE condition and performs data extraction according to that SQL. For example, during testing, you can specify the WHERE condition for the actual business scenario, usually syncing the data of the day by setting the WHERE condition to id>2 and sex=1. |
Parameters | Description |
Data Destination | PostgreSQL data source that needs to be written. |
Database | Supports selection or manual input of the database name to write to By default, the database bound to the data source is used as the default database. Other databases need to be manually entered. If the data source network is not connected and the database information cannot be fetched directly, you can manually enter the database name. Data synchronization can still be performed when the DataInLong network is connected. |
Schema | Supports selection or manual input of the Schema name to be read. |
Table | Supports selection or manual input of the table name to write to If the data source network is not connected and the table information cannot be fetched directly, you can manually enter the table name. Data synchronization can still be performed when the DataInLong network is connected. |
Whether to Clear Table | You can manually choose whether to clear the PostgreSQL data table before writing to it. |
Write Mode | PostgreSQL writing supports two modes:
append: Append write.
upsert: Update and write data based on the set primary key fields. |
Batch Submission Size | The record size of one-time batch submission can significantly reduce the number of network interactions between the data synchronization system and PostgreSQL, and improve overall throughput. If this value is set too large, data synchronization process may encounter OOM exceptions. |
Pre-Executed SQL(Optional) | The SQL statement executed before the synchronization task. Fill in the correct SQL syntax according to the data source type, such as clearing the old data in the table before execution (truncate table tablename). |
Post-Executed SQL (Optional) | SQL statements to be executed after performing the synchronization task. Fill in the correct SQL syntax according to the data source type, for example, adding a timestamp: alter table tablename add colname timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP. |
PostgreSQL data types | Internal Types |
smallint(int2),integer(int4),bigint(int8), serial,bigserial | Long |
real(float4),double precision(float8), money, numeric | Double |
varchar(character varying), char,uuid,json,array | String |
date, time, timestamp | Date |
bool(boolean),bit | Boolean |
bytea | Bytes |
Internal Types | PostgreSQL data types |
Long | smallint(int2),integer(int4),bigint(int8) |
Double | double precision,numeric, real |
String | varchar(character varying),char,bit,money |
Date | date, time, timestamp |
Boolean | bool(boolean) |
Bytes | bytea |
Was this page helpful?