Skip to content

Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.

fix(pam): remove frontend row truncation in favour of server-side isTruncated flag

Bernie Gandina7842be43e7b
diff --git a/frontend/src/pages/pam/PamDataExplorerPage/components/QueryResultsTable.tsx b/frontend/src/pages/pam/PamDataExplorerPage/components/QueryResultsTable.tsx
index 7526c76ac3..19987f99bc 100644
--- a/frontend/src/pages/pam/PamDataExplorerPage/components/QueryResultsTable.tsx
+++ b/frontend/src/pages/pam/PamDataExplorerPage/components/QueryResultsTable.tsx
@@ -7,12 +7,11 @@ import { DataGrid, useDataGrid } from "@app/components/v3/generic/DataGrid";
import type { FieldInfo, ForeignKeyInfo, TableDetail } from "../data-explorer-types";
import { getColumnIndicator } from "../data-explorer-utils";
-const MAX_ROWS = 500;
-
type QueryResult = {
rows: Record<string, unknown>[];
fields: FieldInfo[];
rowCount: number | null;
+ isTruncated: boolean;
command: string;
executionTimeMs: number;
};
@@ -70,8 +69,7 @@ function ResultsGrid({
result: QueryResult;
tableDetail: TableDetail | null;
}) {
- const displayRows = useMemo(() => result.rows.slice(0, MAX_ROWS), [result.rows]);
- const isTruncated = result.rows.length > MAX_ROWS;
+ const { isTruncated } = result;
const columns = useMemo(
() => buildColumns(result.fields, tableDetail),
@@ -81,7 +79,7 @@ function ResultsGrid({
const getRowId = useCallback((_row: RowData, index: number) => String(index), []);
const gridProps = useDataGrid<RowData>({
- data: displayRows,
+ data: result.rows,
columns,
getRowId,
readOnly: true,
@@ -96,7 +94,7 @@ function ResultsGrid({
</div>
{isTruncated && (
<div className="shrink-0 border-t border-mineshaft-600 bg-mineshaft-800 px-3 py-1.5 text-xs text-yellow-500/80">
- Showing first {MAX_ROWS} rows
+ Showing first {result.rows.length.toLocaleString()} rows (results truncated by server)
</div>
)}
</div>