fix(settings): centralize draft normalization and use 60s query timeout

This commit is contained in:
t8y2 committed 2026-09-08 20:39:39 +08:00
1 parent 39e34d44f7
commit 1431d4996f
16 files changed
+239 -360

No files matched your search

+3 -2
View File
@@ -1,15 +1,16 @@
import { splitSqlStatementRanges } from "@/lib/sql/sqlStatementRanges";
import { tokenizeSqlSemantic } from "@/lib/sql/semantic/tokens";
import { DEFAULT_QUERY_TIMEOUT_SECS } from "@/lib/connection/timeoutLimits";
import type { ConnectionConfig, DatabaseType } from "@/types/database";
export const DEFAULT_QUERY_TIMEOUT_SECS = 30;
export { DEFAULT_QUERY_TIMEOUT_SECS } from "@/lib/connection/timeoutLimits";
/**
* Query timeout (seconds) the table structure editor applies when the change
* script contains a PostgreSQL `CREATE INDEX CONCURRENTLY`.
*
* Concurrent builds scan the whole table while only taking `ShareUpdateExclusiveLock`,
* so they routinely run far beyond the default 30s query timeout — the default
* so they routinely run far beyond the default 60s query timeout — the default
* budget would cancel a legitimate build and leave an INVALID index behind.
* PostgreSQL itself does not impose a build deadline
* (https://www.postgresql.org/docs/current/sql-createindex.html). This is the