Query result - added click-throught to returned data #1236

This commit is contained in:
Jan Prochazka
2025-11-05 18:35:33 +01:00
parent 91546228fa
commit 1553ec3bd4
3 changed files with 36 additions and 0 deletions

View File

@@ -83,6 +83,16 @@ module.exports = {
socket.emit(`session-recordset-${sesid}`, { jslid, resultIndex }); socket.emit(`session-recordset-${sesid}`, { jslid, resultIndex });
}, },
handle_endrecordset(sesid, props) {
const { jslid, rowCount, durationMs } = props;
this.dispatchMessage(sesid, {
message: `Query returned ${rowCount} rows in ${durationMs} ms`,
rowCount,
durationMs,
jslid,
});
},
handle_stats(sesid, stats) { handle_stats(sesid, stats) {
jsldata.notifyChangedStats(stats); jsldata.notifyChangedStats(stats);
}, },

View File

@@ -14,6 +14,7 @@ class QueryStreamTableWriter {
this.currentChangeIndex = 1; this.currentChangeIndex = 1;
this.initializedFile = false; this.initializedFile = false;
this.sesid = sesid; this.sesid = sesid;
this.started = new Date().getTime();
} }
initializeFromQuery(structure, resultIndex, chartDefinition, autoDetectCharts = false) { initializeFromQuery(structure, resultIndex, chartDefinition, autoDetectCharts = false) {
@@ -118,6 +119,13 @@ class QueryStreamTableWriter {
this.chartProcessor = null; this.chartProcessor = null;
} }
} }
process.send({
msgtype: 'endrecordset',
jslid: this.jslid,
rowCount: this.currentRowCount,
sesid: this.sesid,
durationMs: new Date().getTime() - this.started,
});
resolve(); resolve();
}); });
} else { } else {

View File

@@ -20,6 +20,7 @@
import SqlHighlighter from '../elements/SqlHighlighter.svelte'; import SqlHighlighter from '../elements/SqlHighlighter.svelte';
import { showModal } from '../modals/modalTools'; import { showModal } from '../modals/modalTools';
import ShowSqlModal from '../modals/ShowSqlModal.svelte'; import ShowSqlModal from '../modals/ShowSqlModal.svelte';
import openNewTab from '../utility/openNewTab';
export let row; export let row;
export let index; export let index;
@@ -59,6 +60,23 @@
}}><FontIcon icon="img ai" /> Explain</InlineButton }}><FontIcon icon="img ai" /> Explain</InlineButton
> >
{/if} {/if}
{#if row.jslid}
<InlineButton
title="Show data"
inlineBlock
data-testid={`MessageViewRow-showDataButton-${index}`}
on:click={e => {
openNewTab({
title: 'Query data #',
icon: 'img query-data',
tabComponent: 'ArchiveFileTab',
props: {
jslid: row.jslid,
},
});
}}><FontIcon icon="img query-data" /> Show Data</InlineButton
>
{/if}
{#if row.sql} {#if row.sql}
<SqlHighlighter <SqlHighlighter
code={row.sql.substring(0, 100) + (row.sql.length > 100 ? '...' : '')} code={row.sql.substring(0, 100) + (row.sql.length > 100 ? '...' : '')}