Skip to content

Database governance built for humans and agents — controlling changes and access across every major database.

chore(sql-editor): tweak data table (#14964)

boojack0a5f9ef65627
diff --git a/frontend/src/views/sql-editor/EditorCommon/ResultView/DataTable/DataTable.vue b/frontend/src/views/sql-editor/EditorCommon/ResultView/DataTable/DataTable.vue
index c2917d1314..1ae9f1d6ad 100644
--- a/frontend/src/views/sql-editor/EditorCommon/ResultView/DataTable/DataTable.vue
+++ b/frontend/src/views/sql-editor/EditorCommon/ResultView/DataTable/DataTable.vue
@@ -2,10 +2,6 @@
<div
ref="containerRef"
class="bb-data-table relative w-full flex-1 overflow-hidden flex flex-col"
- :style="{
- maxHeight: maxHeight ? `${maxHeight}px` : undefined,
- }"
- :data-container-height="containerHeight"
>
<div class="w-full flex-1 flex flex-col overflow-hidden">
<div
@@ -105,11 +101,12 @@
>
<TableCell
:table="table"
- :value="cell.getValue() as RowValue"
+ :value="cell.getValue<RowValue>()"
:keyword="keyword"
:set-index="setIndex"
:row-index="offset + rowIndex"
:col-index="cellIndex"
+ :allow-select="true"
/>
</td>
</tr>
diff --git a/frontend/src/views/sql-editor/EditorCommon/ResultView/DataTable/DataTableLite.vue b/frontend/src/views/sql-editor/EditorCommon/ResultView/DataTable/DataTableLite.vue
index 67251c4ea9..ed70ea2055 100644
--- a/frontend/src/views/sql-editor/EditorCommon/ResultView/DataTable/DataTableLite.vue
+++ b/frontend/src/views/sql-editor/EditorCommon/ResultView/DataTable/DataTableLite.vue
@@ -76,11 +76,12 @@
>
<TableCell
:table="table"
- :value="cell.getValue() as RowValue"
+ :value="cell.getValue<RowValue>()"
:keyword="keyword"
:set-index="setIndex"
:row-index="offset + rowIndex"
:col-index="cellIndex"
+ :allow-select="true"
/>
</td>
</tr>
diff --git a/frontend/src/views/sql-editor/EditorCommon/ResultView/DataTable/TableCell.vue b/frontend/src/views/sql-editor/EditorCommon/ResultView/DataTable/TableCell.vue
index e2bd9305a3..ee051984f1 100644
--- a/frontend/src/views/sql-editor/EditorCommon/ResultView/DataTable/TableCell.vue
+++ b/frontend/src/views/sql-editor/EditorCommon/ResultView/DataTable/TableCell.vue
@@ -45,6 +45,7 @@ const props = defineProps<{
setIndex: number;
rowIndex: number;
colIndex: number;
+ allowSelect?: boolean;
}>();
const { dark, disallowCopyingData, detail, keyword } =
@@ -58,6 +59,10 @@ const {
const wrapperRef = ref<HTMLDivElement>();
const truncated = ref(false);
+const allowSelect = computed(() => {
+ return props.allowSelect && !selectionDisabled.value;
+});
+
useResizeObserver(wrapperRef, (entries) => {
const div = entries[0].target as HTMLDivElement;
const contentWidth = div.scrollWidth;
@@ -88,7 +93,7 @@ const classes = computed(() => {
if (disallowCopyingData.value) {
classes.push("select-none");
}
- if (!selectionDisabled.value) {
+ if (allowSelect.value) {
if (props.colIndex === 0) {
classes.push("cursor-pointer");
classes.push("hover:bg-accent/10 hover:dark:bg-accent/40");
@@ -133,7 +138,7 @@ const html = computed(() => {
});
const handleClick = (e: MouseEvent) => {
- if (props.colIndex === 0 && !selectionDisabled.value) {
+ if (props.colIndex === 0 && allowSelect.value) {
selectRow(props.rowIndex);
e.stopPropagation();
}
diff --git a/frontend/src/views/sql-editor/EditorCommon/ResultView/ResultViewV1.vue b/frontend/src/views/sql-editor/EditorCommon/ResultView/ResultViewV1.vue
index 8fd43a7c5a..9fbc03320f 100644
--- a/frontend/src/views/sql-editor/EditorCommon/ResultView/ResultViewV1.vue
+++ b/frontend/src/views/sql-editor/EditorCommon/ResultView/ResultViewV1.vue
@@ -12,7 +12,6 @@
:sql-result-set="resultSet"
:result="resultSet.results[0]"
:set-index="0"
- :max-data-table-height="maxDataTableHeight"
/>
</template>
<template v-else-if="viewMode === 'MULTI-RESULT'">
@@ -151,10 +150,6 @@ const props = defineProps({
type: Boolean,
default: false,
},
- maxDataTableHeight: {
- type: Number,
- default: undefined,
- },
});
const { t } = useI18n();
diff --git a/frontend/src/views/sql-editor/EditorCommon/ResultView/SingleResultViewV1.vue b/frontend/src/views/sql-editor/EditorCommon/ResultView/SingleResultViewV1.vue
index 142693ce11..75f5d4f587 100644
--- a/frontend/src/views/sql-editor/EditorCommon/ResultView/SingleResultViewV1.vue
+++ b/frontend/src/views/sql-editor/EditorCommon/ResultView/SingleResultViewV1.vue
@@ -34,9 +34,7 @@
<span class="ml-2">{{ $t("sql-editor.rows-upper-limit") }}</span>
</span>
</div>
- <div
- class="flex justify-between items-center shrink-0 gap-x-3 overflow-y-hidden hide-scrollbar"
- >
+ <div class="flex justify-between items-center shrink-0 gap-x-3">
<div class="flex items-center">
<NSwitch v-model:value="state.vertical" size="small" />
<span class="ml-1 whitespace-nowrap text-sm text-gray-500">
@@ -125,7 +123,6 @@
:offset="pageIndex * pageSize"
:is-sensitive-column="isSensitiveColumn"
:is-column-missing-sensitive="isColumnMissingSensitive"
- :max-height="maxDataTableHeight"
/>
<DataTable
v-else
@@ -134,7 +131,6 @@
:offset="pageIndex * pageSize"
:is-sensitive-column="isSensitiveColumn"
:is-column-missing-sensitive="isColumnMissingSensitive"
- :max-height="maxDataTableHeight"
/>
</template>
</div>
@@ -274,7 +270,6 @@ const props = defineProps<{
sqlResultSet: SQLResultSetV1;
result: QueryResult;
setIndex: number;
- maxDataTableHeight?: number;
}>();
const state = reactive<LocalState>({
diff --git a/frontend/src/views/sql-editor/EditorPanel/TerminalPanel/TerminalPanel.vue b/frontend/src/views/sql-editor/EditorPanel/TerminalPanel/TerminalPanel.vue
index 00c3b23c77..9a8029d0d4 100644
--- a/frontend/src/views/sql-editor/EditorPanel/TerminalPanel/TerminalPanel.vue
+++ b/frontend/src/views/sql-editor/EditorPanel/TerminalPanel/TerminalPanel.vue
@@ -39,7 +39,7 @@
</Suspense>
<ResultViewV1
v-if="query.params && query.resultSet"
- class="flex-1 flex flex-col overflow-hidden"
+ class="flex-1 flex flex-col overflow-hidden max-h-80"
:execute-params="query.params"
:result-set="query.resultSet"
:database="
@@ -47,7 +47,6 @@
"
:loading="query.status === 'RUNNING'"
:dark="true"
- :max-data-table-height="320"
/>
<div