From 47b7b492d37e8edfb7d066aba847b9712b4044b6 Mon Sep 17 00:00:00 2001 From: t8y2 Date: Tue, 13 Oct 2026 16:14:58 +0800 Subject: [PATCH] fix(data): harden transfer and comparison workflows --- .../src/components/diff/DataCompareDialog.vue | 20 +- .../DataCompareDialog.keyColumns.spec.ts | 1 + .../DataCompareDialog.prefill.spec.ts | 1 + .../__tests__/useDataCompareSession.spec.ts | 10 +- .../src/composables/useDataCompareSession.ts | 21 +- apps/desktop/src/i18n/locales/en.ts | 4 +- apps/desktop/src/i18n/locales/zh-CN.ts | 4 +- .../database/databaseDriverManifest.spec.ts | 27 +- apps/desktop/src/lib/dataGrid/dataCompare.ts | 4 +- .../databaseCompareCapabilities.spec.ts | 16 + .../database/databaseCompareCapabilities.ts | 78 +- .../lib/database/databaseDriverManifest.ts | 18 + .../src/lib/database/transferObjectKinds.ts | 17 +- .../assets/database-drivers.manifest.json | 279 +++++++ crates/dbx-core/src/data/correction.rs | 1 + crates/dbx-core/src/data/data_compare.rs | 120 ++- crates/dbx-core/src/data/mod.rs | 2 + crates/dbx-core/src/data/sample_pairing.rs | 18 + crates/dbx-core/src/data/transfer.rs | 41 +- crates/dbx-core/src/data/transfer_runner.rs | 694 ++++++++++++++++++ crates/dbx-core/src/lib.rs | 1 + .../tests/regression_compatibility.rs | 39 +- crates/dbx-core/tests/sample_pairing.rs | 26 + crates/dbx-types/src/database_manifest.rs | 71 ++ crates/dbx-web/src/routes/transfer.rs | 508 +------------ plugins/connection-types/access.yaml | 1 + plugins/connection-types/argo.yaml | 2 + plugins/connection-types/bigquery.yaml | 1 + plugins/connection-types/clickhouse.yaml | 2 + plugins/connection-types/cloudflare-d1.yaml | 2 + plugins/connection-types/dameng.yaml | 3 + plugins/connection-types/databend.yaml | 1 + plugins/connection-types/databricks.yaml | 1 + plugins/connection-types/db2.yaml | 2 + plugins/connection-types/doris.yaml | 1 + plugins/connection-types/duckdb.yaml | 2 + plugins/connection-types/exasol.yaml | 1 + plugins/connection-types/firebird.yaml | 1 + plugins/connection-types/gaussdb.yaml | 3 + plugins/connection-types/gbase.yaml | 2 + plugins/connection-types/goldendb.yaml | 2 + plugins/connection-types/h2.yaml | 2 + plugins/connection-types/highgo.yaml | 2 + plugins/connection-types/hive.yaml | 2 + plugins/connection-types/ignite.yaml | 1 + plugins/connection-types/ignite3.yaml | 1 + plugins/connection-types/impala.yaml | 2 + plugins/connection-types/influxdb3.yaml | 1 + plugins/connection-types/informix.yaml | 1 + plugins/connection-types/iotdb.yaml | 1 + plugins/connection-types/iris.yaml | 2 + plugins/connection-types/kingbase.yaml | 3 + plugins/connection-types/kwdb.yaml | 3 + plugins/connection-types/kylin.yaml | 1 + plugins/connection-types/kyuubi.yaml | 2 + plugins/connection-types/manticoresearch.yaml | 1 + plugins/connection-types/mongodb.yaml | 1 + plugins/connection-types/mysql.yaml | 3 + .../connection-types/oceanbase-oracle.yaml | 3 + plugins/connection-types/opengauss.yaml | 3 + plugins/connection-types/oracle.yaml | 3 + plugins/connection-types/oscar.yaml | 1 + plugins/connection-types/postgres.yaml | 3 + plugins/connection-types/prestosql.yaml | 1 + plugins/connection-types/questdb.yaml | 2 + plugins/connection-types/redshift.yaml | 1 + plugins/connection-types/rqlite.yaml | 2 + plugins/connection-types/saphana.yaml | 1 + plugins/connection-types/snowflake.yaml | 1 + plugins/connection-types/spanner.yaml | 1 + plugins/connection-types/spark.yaml | 2 + plugins/connection-types/sqlite.yaml | 2 + plugins/connection-types/sqlserver.yaml | 3 + plugins/connection-types/starrocks.yaml | 1 + plugins/connection-types/sundb.yaml | 1 + plugins/connection-types/tdengine.yaml | 1 + plugins/connection-types/teradata.yaml | 1 + plugins/connection-types/transwarp.yaml | 2 + plugins/connection-types/trino.yaml | 1 + plugins/connection-types/turso.yaml | 2 + plugins/connection-types/uxdb.yaml | 1 + plugins/connection-types/vastbase.yaml | 2 + plugins/connection-types/vertica.yaml | 1 + plugins/connection-types/xugu.yaml | 2 + plugins/connection-types/yashandb.yaml | 2 + scripts/core-architecture.test.mjs | 32 + scripts/sync-connection-types.mjs | 30 + src-tauri/src/commands/transfer.rs | 535 +------------- 88 files changed, 1564 insertions(+), 1156 deletions(-) create mode 100644 apps/desktop/src/lib/database/__tests__/databaseCompareCapabilities.spec.ts create mode 100644 crates/dbx-core/src/data/sample_pairing.rs create mode 100644 crates/dbx-core/src/data/transfer_runner.rs create mode 100644 crates/dbx-core/tests/sample_pairing.rs diff --git a/apps/desktop/src/components/diff/DataCompareDialog.vue b/apps/desktop/src/components/diff/DataCompareDialog.vue index 30203edc10..15d610b142 100644 --- a/apps/desktop/src/components/diff/DataCompareDialog.vue +++ b/apps/desktop/src/components/diff/DataCompareDialog.vue @@ -833,6 +833,7 @@ function toggleShowAll(table: DataCompareTableResult, kind: DiffKind) { function setDiffSelection(kind: DiffKind, selected: boolean) { if (executionLocked.value) return; batchResults.value.forEach((table) => { + if (!table.syncEligible) return; table.diff[kind].forEach((row) => { row.selected = selected; }); @@ -841,7 +842,7 @@ function setDiffSelection(kind: DiffKind, selected: boolean) { } function setTableDiffSelection(table: DataCompareTableResult, kind: DiffKind, selected: boolean) { - if (executionLocked.value) return; + if (executionLocked.value || !table.syncEligible) return; table.diff[kind].forEach((row) => { row.selected = selected; }); @@ -860,8 +861,8 @@ function clearAllSelections() { rebuildSyncPlan().catch((e) => toast(String(e), 5000)); } -function toggleRowSelection(row: SelectableDataCompareRow | SelectableDataCompareModifiedRow) { - if (executionLocked.value) return; +function toggleRowSelection(table: DataCompareTableResult, row: SelectableDataCompareRow | SelectableDataCompareModifiedRow) { + if (executionLocked.value || !table.syncEligible) return; row.selected = !row.selected; rebuildSyncPlan().catch((e) => toast(String(e), 5000)); } @@ -1631,10 +1632,10 @@ onBeforeUnmount(() => { {{ t(`diff.${kind}`) }} {{ selectedRows(item, kind) }}/{{ item.diff[kind].length }} - -