fix(schema-diff): refresh table lists before comparing

This commit is contained in:
jearhe authored and GitHub committed 2026-08-27 08:38:20 +08:00
1 parent 168e7bcb54
commit 6875ca4000
3 files changed
+23 -5

No files matched your search

@@ -441,7 +441,9 @@ async function handleCompare() {
const sourceTableIdentity: SchemaDiffTableIdentity = { connectionId: sourceConnectionId.value, database: sourceDatabase.value, schema: sourceSchema.value };
const targetTableIdentity: SchemaDiffTableIdentity = { connectionId: targetConnectionId.value, database: targetDatabase.value, schema: targetSchema.value };
const [srcTables, tgtTables] = await Promise.all([schemaDiffTableListLoader.load(sourceTableIdentity), schemaDiffTableListLoader.load(targetTableIdentity)]);
// The dialog can remain open while either database changes, so Compare must not reuse
// the table list cached while configuring the comparison.
const [srcTables, tgtTables] = await Promise.all([schemaDiffTableListLoader.load(sourceTableIdentity, { refresh: true }), schemaDiffTableListLoader.load(targetTableIdentity, { refresh: true })]);
// Explicit (visual) table selection is applied here, BEFORE any per-table
// metadata details are loaded, so metadata requests only happen for the
// final table set. `undefined`/empty means no restriction (legacy path).