Skip to content

Commit 43b3a7d

Browse files
committed
show row limits
1 parent cc79d65 commit 43b3a7d

File tree

1 file changed

+3
-2
lines changed
  • src/components/QuestDbSqlRunnerEmbedded

1 file changed

+3
-2
lines changed

src/components/QuestDbSqlRunnerEmbedded/index.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ interface QuestDBErrorResponse {query: string; error: string; position?: number;
66
type QuestDBResponse = QuestDBSuccessfulResponse | QuestDBErrorResponse;
77

88
const QUESTDB_DEMO_URL_EMBEDDED: string = 'https://demo.questdb.io';
9+
const ROW_LIMIT = 20;
910

1011
interface QuestDbSqlRunnerEmbeddedProps {
1112
queryToExecute: string;
@@ -42,7 +43,7 @@ export function QuestDbSqlRunnerEmbedded({
4243
setNonTabularResponse(null); setRowCount(null);
4344

4445
const encodedQuery = encodeURIComponent(queryToExecute);
45-
const url = `${questdbUrl}/exec?query=${encodedQuery}&count=true&timings=true&limit=20`;
46+
const url = `${questdbUrl}/exec?query=${encodedQuery}&count=true&timings=true&limit=${ROW_LIMIT}`;
4647

4748
try {
4849
const response = await fetch(url);
@@ -129,7 +130,7 @@ export function QuestDbSqlRunnerEmbedded({
129130
</table>
130131
</div>
131132
)}
132-
{rowCount !== null && <p>Total rows: {rowCount}</p>}
133+
{rowCount !== null && <p>Showing {Math.min(rowCount, ROW_LIMIT)} out of {rowCount} rows</p>}
133134
</div>
134135
)}
135136
</div>

0 commit comments

Comments
 (0)