[editor] Show rows in reverse order for streaming results in the ResultTable component
}));
}
+ const addRows = (existingRows: ResultRow[], newRows: ResultRow[]) => {
+ newRows.forEach(row => {
+ if (streaming.value) {
+ existingRows.unshift(row);
+ } else {
+ existingRows.push(row);
+ }
+ });
+ };
+
if (refresh) {
- rows.value = executionResult.rows;
+ const existingRows: ResultRow[] = [];
+ addRows(existingRows, executionResult.rows);
+ rows.value = existingRows;
} else if (
executionResult.lastRows.length &&
rows.value.length !== executionResult.rows.length
) {
- rows.value.push(...executionResult.lastRows);
+ addRows(rows.value, executionResult.lastRows);
}
}
};
