fix(grid): inherit timeout for row counts

This commit is contained in:
t8y2 committed 2026-07-13 20:13:32 +08:00
1 parent 2cb58b0b5a
commit e2f53a786f
3 files changed
+41 -2

No files matched your search

@@ -0,0 +1,14 @@
import { queryTimeoutSecsForConnection } from "@/lib/sql/queryTimeout";
import type { ConnectionConfig } from "@/types/database";
export function dataGridCountQueryOptions(connection?: Pick<ConnectionConfig, "query_timeout_secs"> | null): {
maxRows: number;
timeoutSecs: number;
} {
// COUNT queries can be slower than the paged query they summarize. Always
// inherit the connection setting instead of falling back to the backend's shorter legacy default.
return {
maxRows: 1,
timeoutSecs: queryTimeoutSecsForConnection(connection),
};
}