+
+
+
([])
const connectionsTotalPage = computed(() =>
Math.ceil(connectionsTotal.value / pageSize),
@@ -135,7 +144,7 @@ export function useFetchConnections() {
size: tableState.pageSize,
where: {
meta_type: {
- in: ['collection', 'table'],
+ in: ['collection', 'table', 'view'],
},
is_deleted: false,
sourceType: 'SOURCE',
@@ -149,6 +158,7 @@ export function useFetchConnections() {
id: true,
source: true,
original_name: true,
+ meta_type: true,
},
// order: ['original_name ASC'],
}
@@ -189,6 +199,7 @@ export function useFetchConnections() {
id: tb.id,
name: tb.original_name,
comment: tb.comment,
+ meta_type: tb.meta_type,
sourceName: tb.source?.name,
sourceId: tb.source?.id,
}))
diff --git a/packages/dag/src/composables/useFormScope.ts b/packages/dag/src/composables/useFormScope.ts
index 73d4afe50..45c1ab716 100644
--- a/packages/dag/src/composables/useFormScope.ts
+++ b/packages/dag/src/composables/useFormScope.ts
@@ -480,7 +480,7 @@ export function useFormScope({ canvasRef }) {
filter.where &&
Object.assign(filter.where, {
meta_type: {
- in: ['collection', 'table'],
+ in: ['collection', 'table', 'view'],
},
is_deleted: false,
sourceType: 'SOURCE',
@@ -488,6 +488,7 @@ export function useFormScope({ canvasRef }) {
Object.assign(filter, {
fields: {
original_name: true,
+ meta_type: true,
},
order: ['original_name ASC'],
})
@@ -505,6 +506,7 @@ export function useFormScope({ canvasRef }) {
return {
label: item.original_name + (item.comment ? `(${item.comment})` : ''),
value: item.original_name,
+ meta_type: item.meta_type,
}
})
const table = filter.where.original_name?.like
diff --git a/packages/dag/src/locale/lang/en.js b/packages/dag/src/locale/lang/en.js
index 81b5eac6e..8037b402d 100644
--- a/packages/dag/src/locale/lang/en.js
+++ b/packages/dag/src/locale/lang/en.js
@@ -1101,6 +1101,7 @@ export default {
'You have not enabled data validation',
packages_dag_only_include_pk: 'Only Include Primary Key',
packages_dag_only_include_uk: 'Only Include Unique Index',
+ packages_dag_only_include_views: 'Views Only',
packages_dag_auto_repair: 'Auto Repair',
packages_dag_auto_repair_tips: 'Enable auto repair',
packages_dag_auto_repair_disabled_tips:
diff --git a/packages/dag/src/locale/lang/zh-CN.js b/packages/dag/src/locale/lang/zh-CN.js
index bd58a07b7..7baa9efa8 100644
--- a/packages/dag/src/locale/lang/zh-CN.js
+++ b/packages/dag/src/locale/lang/zh-CN.js
@@ -893,6 +893,7 @@ export default {
'主从合并后不支持将 {val} 作为写入目标',
packages_dag_only_include_pk: '仅包含主键',
packages_dag_only_include_uk: '仅包含唯一索引',
+ packages_dag_only_include_views: '仅包含视图',
packages_dag_full_validation: '全量校验',
packages_dag_incremental_validation: '增量校验',
packages_dag_incremental_validation_tips: '仅校验新增和修改的数据',
diff --git a/packages/dag/src/mixins/formScope.js b/packages/dag/src/mixins/formScope.js
index d2485ec69..869563909 100644
--- a/packages/dag/src/mixins/formScope.js
+++ b/packages/dag/src/mixins/formScope.js
@@ -363,7 +363,7 @@ export default {
filter.where &&
Object.assign(filter.where, {
meta_type: {
- in: ['collection', 'table'],
+ in: ['collection', 'table', 'view'],
},
is_deleted: false,
sourceType: 'SOURCE',
diff --git a/packages/dag/src/nodes/Database.js b/packages/dag/src/nodes/Database.js
index d08c682e4..1b4b914d9 100644
--- a/packages/dag/src/nodes/Database.js
+++ b/packages/dag/src/nodes/Database.js
@@ -240,6 +240,10 @@ export class Database extends NodeType {
),
value: 'NoKeys',
},
+ {
+ label: i18n.t('packages_dag_only_include_views'),
+ value: 'View',
+ },
],
},
syncSourcePartitionTableEnable: {
diff --git a/packages/dag/src/util.ts b/packages/dag/src/util.ts
index e09e86b22..a8513bc3c 100644
--- a/packages/dag/src/util.ts
+++ b/packages/dag/src/util.ts
@@ -143,6 +143,9 @@ export function getPrimaryKeyTablesByType(
case 'NoKeys':
list = result.filter((t) => !t.primaryKeyCounts && !t.uniqueIndexCounts)
break
+ case 'View':
+ list = result.filter((t) => t.meta_type === 'view')
+ break
default:
list = result
}
diff --git a/packages/ldp/src/MDM.vue b/packages/ldp/src/MDM.vue
index 7c9fe1cb1..248ff5bec 100644
--- a/packages/ldp/src/MDM.vue
+++ b/packages/ldp/src/MDM.vue
@@ -994,7 +994,7 @@ async function loadFields() {
size: 1,
where: {
'source.id': taskDialogConfig.value.from.id,
- meta_type: { in: ['collection', 'table'] },
+ meta_type: { in: ['collection', 'table', 'view'] },
is_deleted: false,
sourceType: 'SOURCE',
original_name: taskDialogConfig.value.tableName,