fix(schema-diff): skip view DDL when disabled

This commit is contained in:
digyear authored and GitHub committed 2026-07-25 08:45:26 +08:00
1 parent 9cfee7f497
commit 3e8e7a4146
3 files changed
+18 -3

No files matched your search

@@ -1,3 +1,5 @@
import type { SchemaDiffCompareOptions } from "@/types/schemaDiff";
const MYSQL_LARGE_SCHEMA_DIFF_METADATA_CONCURRENCY = 2;
const MYSQL_SMALL_SCHEMA_DIFF_METADATA_CONCURRENCY = 4;
const MYSQL_SMALL_SCHEMA_TABLE_LIMIT = 30;
@@ -18,6 +20,10 @@ export function schemaDiffMetadataConcurrency(dbType: string | null | undefined,
return DEFAULT_SCHEMA_DIFF_METADATA_CONCURRENCY;
}
export function shouldFetchSchemaDiffDdl(isView: boolean, options: Pick<SchemaDiffCompareOptions, "tables" | "views">): boolean {
return isView ? options.views : options.tables;
}
export async function mapWithConcurrency<T, R>(items: readonly T[], limit: number, worker: (item: T, index: number) => Promise<R>): Promise<R[]> {
const workerCount = Math.min(normalizeConcurrencyLimit(limit), items.length);
if (workerCount === 0) return [];