fix: 隔离 MySQL 大库场景前台查询与后台元数据加载 (#2354)

* fix: isolate data tab mysql queries from metadata loads

* refactor(completion): drop unused limiter snapshot and share concurrency constant

---------

Co-authored-by: zero <zero@zeroMacmini.local>
Co-authored-by: t8y2 <1156263951@qq.com>
This commit is contained in:
authored and GitHub committed 2026-07-01 20:03:09 +08:00
1 parent 30f1c58e9d
commit ff1a0f5eda
9 files changed
+524 -131

No files matched your search

@@ -14,7 +14,7 @@ import { buildExecutionCandidates, hasMultipleExecutionTargets, supportsExecutio
import { executableStatementRangeCacheForDoc, executableStatementRangeStartingAt as executableStatementRangeStartingAtLine, type ExecutableStatementRangeCache } from "@/lib/executableStatementRangeCache";
import { formatSqlText, type SqlFormatDialect } from "@/lib/sqlFormatter";
import { formatMongoShellText } from "@/lib/mongoFormatter";
import { useConnectionStore } from "@/stores/connectionStore";
import { useConnectionStore, COMPLETION_METADATA_CONCURRENCY } from "@/stores/connectionStore";
import { useSettingsStore } from "@/stores/settingsStore";
import { useTheme } from "@/composables/useTheme";
import { useToast } from "@/composables/useToast";
@@ -801,7 +801,9 @@ async function ensureForeignKeysForTables(tables: Array<{ name: string; schema?:
seen.add(key);
return true;
});
await Promise.all(uniqueTables.map((table) => ensureForeignKeysForTable(table)));
for (let index = 0; index < uniqueTables.length; index += COMPLETION_METADATA_CONCURRENCY) {
await Promise.all(uniqueTables.slice(index, index + COMPLETION_METADATA_CONCURRENCY).map((table) => ensureForeignKeysForTable(table)));
}
}
function createHoverDom(title: string, detail: string, rows: string[] = []) {