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

@@ -9,7 +9,7 @@ export interface SchemaDiffTableIdentity {
}
export interface SchemaDiffTableListLoader {
load(identity: SchemaDiffTableIdentity): Promise<TableInfo[]>;
load(identity: SchemaDiffTableIdentity, options?: { refresh?: boolean }): Promise<TableInfo[]>;
}
interface SchemaDiffTableListLoaderDependencies {
@@ -46,12 +46,12 @@ export function createSchemaDiffTableListLoader(dependencies: SchemaDiffTableLis
const pending = new Map<string, Promise<TableInfo[]>>();
return {
async load(identity) {
async load(identity, options) {
const key = identityKey(identity);
const inFlight = pending.get(key);
if (inFlight) return inFlight;
const cached = successful.get(key);
const cached = options?.refresh ? undefined : successful.get(key);
if (cached) {
await dependencies.ensureConnected(identity.connectionId);
return cached;