Table Config
CollectorTableConfig​
| Field | Type | Description |
|---|---|---|
| configId | str | Unique key. Auto-generated. |
| name | str | config name. |
| modelName | str | It belongs to which model. |
| objectKey | str | Business key column |
| tableName | str | Table of extraction |
| primaryKey | list | primary key of the extracted table. |
| parentName | str | name of parent configuration. |
| joinKeys | list | Associated field between parent and child tables. |
| dependOn | list | Used for root table. When JSON is pushed to raw topic, determine its dependencies. |
| conditions | list | Set conditions to filter data during extraction |
| label | str | Node name in JSON |
| isList | bool | Is list or not. |
| dataSourceId | str | Then configuration of source db which data will be extracted. |
| auditColumn | str | Audit column for CDC query |
| triggered | bool | Enable the current configuration. |
| tenantId | str | Tenant id. Auto-generated by system when created. |
| createdAt | datetime | Audit column. Auto-generated. |
| createdBy | str | Audit column. Auto-generated. |
| lastModifiedAt | datetime | Audit column. Auto-generated. |
| lastModifiedBy | str | Audit column. Auto-generated. |
| version | int | Optimistic locking. Auto-generated. |
API​
create or update table config:
| API | Description | Method | Request | Response |
|---|---|---|---|---|
| /collector/table/config | create table configuration | POST | CollectorTableConfig | CollectorTableConfig |
For Example​
1. Create configuration of table "t_party", it is the root table of "party" model:​
request:
{
"name": "t_party",
"modelName": "party",
"objectKey": "party_id",
"tableName": "t_party",
"primaryKey": [
"party_id"
],
"dataSourceId": "1076175258178714624",
"auditColumn": "update_timestamp",
"isList": false,
"triggered": true
}
response:
{
"configId": "1077188883923622884",
"name": "t_party",
"modelName": "party",
"objectKey": "party_id",
"tableName": "t_party",
"primaryKey": [
"party_id"
],
"dataSourceId": "1076175258178714624",
"auditColumn": "update_timestamp",
"isList": false,
"triggered": true,
"tenantId": "1",
"createdAt": "2023-02-20T11:20:03",
"createdBy": "2",
"lastModifiedAt": "2023-02-20T11:20:03",
"lastModifiedBy": "2",
"version": 1
}
2. Create configuration of table "t_customer", it is child of table "t_party":​
request:
{
"name": "t_customer",
"modelName": "party",
"objectKey": "party_id",
"tableName": "t_customer",
"primaryKey": [
"customer_id"
],
"parentName": "t_party",
"joinKeys": [
{
"childKey": "customer_id",
"parentKey": "party_id"
}
],
"label": "customer",
"auditColumn": "update_timestamp",
"dataSourceId": "1077240721411228672",
"isList": false,
"triggered": true
}
response:
{
"configId": "1077188883923623936",
"name": "t_customer",
"modelName": "party",
"objectKey": "party_id",
"tableName": "t_customer",
"parentName": "t_party",
"joinKeys": [
{
"childKey": "customer_id",
"parentKey": "party_id"
}
],
"primaryKey": [
"customer_id"
],
"label": "customer",
"auditColumn": "update_timestamp",
"dataSourceId": "1077240721411228672",
"isList": false,
"triggered": true,
"tenantId": "1",
"createdAt": "2023-02-20T11:24:03",
"createdBy": "2",
"lastModifiedAt": "2023-02-20T11:24:03",
"lastModifiedBy": "2",
"version": 1
}