Skip to content

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

feat: table and column info panel (#9128)

Liu Ji41e3bf1e7c2f
diff --git a/frontend/src/views/sql-editor/AsidePanel/DatabaseHoverPanel.vue b/frontend/src/views/sql-editor/AsidePanel/DatabaseHoverPanel.vue
index c700d1acde..17b0084d00 100644
--- a/frontend/src/views/sql-editor/AsidePanel/DatabaseHoverPanel.vue
+++ b/frontend/src/views/sql-editor/AsidePanel/DatabaseHoverPanel.vue
@@ -98,7 +98,7 @@ const show = computed(
useEventListener(popoverRef, "mouseenter", () => {
// Reset the value immediately to cancel other pending setting values
- update(node.value, "before" /* overrideDelay */);
+ update(node.value, "before", 0 /* overrideDelay */);
});
useEventListener(popoverRef, "mouseleave", () => {
update(undefined, "before");
diff --git a/frontend/src/views/sql-editor/SecondarySidebar/InfoTabPane/SchemaPanel/ColumnList.vue b/frontend/src/views/sql-editor/SecondarySidebar/InfoTabPane/SchemaPanel/ColumnList.vue
index 0866c35160..9c2e07515f 100644
--- a/frontend/src/views/sql-editor/SecondarySidebar/InfoTabPane/SchemaPanel/ColumnList.vue
+++ b/frontend/src/views/sql-editor/SecondarySidebar/InfoTabPane/SchemaPanel/ColumnList.vue
@@ -7,7 +7,11 @@
:item-size="24"
>
<template #default="{ item: column }: VirtualListItem">
- <div class="flex items-start px-4">
+ <div
+ class="bb-column-list--column-item flex items-start mx-3 px-1 cursor-pointer hover:bg-control-bg-hover/50"
+ @mouseenter="handleMouseEnter($event, column)"
+ @mouseleave="handleMouseLeave($event, column)"
+ >
<!-- eslint-disable vue/no-v-html -->
<div
class="text-sm leading-6 text-gray-600whitespace-pre-wrap break-words flex-2 min-w-[4rem]"
@@ -26,13 +30,17 @@
<script setup lang="ts">
import { escape } from "lodash-es";
-import { computed } from "vue";
+import { computed, nextTick } from "vue";
import { VirtualList } from "vueuc";
+import { ComposedDatabase } from "@/types";
import {
ColumnMetadata,
+ DatabaseMetadata,
+ SchemaMetadata,
TableMetadata,
} from "@/types/proto/v1/database_service";
-import { getHighlightHTMLByRegExp } from "@/utils";
+import { findAncestor, getHighlightHTMLByRegExp } from "@/utils";
+import { useHoverStateContext } from "./HoverPanel";
import { useSchemaPanelContext } from "./context";
export type VirtualListItem = {
@@ -41,9 +49,17 @@ export type VirtualListItem = {
};
const props = defineProps<{
+ db: ComposedDatabase;
+ database: DatabaseMetadata;
+ schema: SchemaMetadata;
table: TableMetadata;
}>();
+const {
+ state: hoverState,
+ position: hoverPosition,
+ update: updateHoverState,
+} = useHoverStateContext();
const { keyword } = useSchemaPanelContext();
const filteredColumnList = computed(() => {
const kw = keyword.value.toLowerCase().trim();
@@ -66,4 +82,36 @@ const renderColumnName = (column: ColumnMetadata) => {
false /* !caseSensitive */
);
};
+
+const handleMouseEnter = (e: MouseEvent, column: ColumnMetadata) => {
+ const { db, database, schema, table } = props;
+ if (hoverState.value) {
+ updateHoverState(
+ { db, database, schema, table, column },
+ "before",
+ 0 /* overrideDelay */
+ );
+ } else {
+ updateHoverState({ db, database, schema, table, column }, "before");
+ }
+ nextTick().then(() => {
+ // Find the node element and put the database panel to the top-left corner
+ // of the node
+ const wrapper = findAncestor(
+ e.target as HTMLElement,
+ ".bb-column-list--column-item"
+ );
+ if (!wrapper) {
+ updateHoverState(undefined, "after", 0 /* overrideDelay */);
+ return;
+ }
+ const bounding = wrapper.getBoundingClientRect();
+ hoverPosition.value.x = bounding.left;
+ hoverPosition.value.y = bounding.top;
+ });
+};
+
+const handleMouseLeave = (e: MouseEvent, column: ColumnMetadata) => {
+ updateHoverState(undefined, "after");
+};
</script>
diff --git a/frontend/src/views/sql-editor/SecondarySidebar/InfoTabPane/SchemaPanel/DatabaseSchema.vue b/frontend/src/views/sql-editor/SecondarySidebar/InfoTabPane/SchemaPanel/DatabaseSchema.vue
index 809091939a..7a51fecc0c 100644
--- a/frontend/src/views/sql-editor/SecondarySidebar/InfoTabPane/SchemaPanel/DatabaseSchema.vue
+++ b/frontend/src/views/sql-editor/SecondarySidebar/InfoTabPane/SchemaPanel/DatabaseSchema.vue
@@ -39,6 +39,8 @@
<TableList
class="flex-1 w-full py-1"
+ :db="database"
+ :database="databaseMetadata"
:schema-list="availableSchemas"
:row-clickable="rowClickable"
@select-table="(schema, table) => $emit('select-table', schema, table)"
diff --git a/frontend/src/views/sql-editor/SecondarySidebar/InfoTabPane/SchemaPanel/HoverPanel/ColumnInfo.vue b/frontend/src/views/sql-editor/SecondarySidebar/InfoTabPane/SchemaPanel/HoverPanel/ColumnInfo.vue
new file mode 100644
index 0000000000..ff2ae827d8
--- /dev/null
+++ b/frontend/src/views/sql-editor/SecondarySidebar/InfoTabPane/SchemaPanel/HoverPanel/ColumnInfo.vue
@@ -0,0 +1,72 @@
+<template>
+ <div
+ class="grid min-w-[14rem] max-w-[18rem] gap-x-2 gap-y-1 break-all"
+ style="grid-template-columns: auto 1fr"
+ >
+ <InfoItem :title="$t('common.name')">
+ {{ column.name }}
+ </InfoItem>
+ <InfoItem :title="$t('common.type')">
+ {{ column.type }}
+ </InfoItem>
+ <InfoItem :title="$t('common.Default')">
+ {{ getColumnDefaultValuePlaceholder(column) }}
+ </InfoItem>
+ <InfoItem :title="$t('database.nullable')">
+ {{ column.nullable }}
+ </InfoItem>
+ <InfoItem v-if="characterSet" :title="$t('db.character-set')">
+ {{ characterSet }}
+ </InfoItem>
+ <InfoItem v-if="collation" :title="$t('db.collation')">
+ {{ collation }}
+ </InfoItem>
+ <InfoItem v-if="column.userComment" :title="$t('database.comment')">
+ {{ column.userComment }}
+ </InfoItem>
+ </div>
+</template>
+
+<script setup lang="ts">
+import { computed } from "vue";
+import { getColumnDefaultValuePlaceholder } from "@/components/SchemaEditorV1/utils/columnDefaultValue";
+import { ComposedDatabase } from "@/types";
+import { Engine } from "@/types/proto/v1/common";
+import {
+ ColumnMetadata,
+ DatabaseMetadata,
+ SchemaMetadata,
+ TableMetadata,
+} from "@/types/proto/v1/database_service";
+import InfoItem from "./InfoItem.vue";
+
+const props = defineProps<{
+ db: ComposedDatabase;
+ database: DatabaseMetadata;
+ schema: SchemaMetadata;
+ table: TableMetadata;
+ column: ColumnMetadata;
+}>();
+
+const instanceEngine = computed(() => {
+ return props.db.instanceEntity.engine;
+});
+
+const characterSet = computed(() => {
+ if (
+ [Engine.POSTGRES, Engine.CLICKHOUSE, Engine.SNOWFLAKE].includes(
+ instanceEngine.value
+ )
+ ) {
+ return props.column.characterSet;
+ }
+ return "";
+});
+
+const collation = computed(() => {
+ if ([Engine.CLICKHOUSE, Engine.SNOWFLAKE].includes(instanceEngine.value)) {
+ return props.column.collation;
+ }
+ return "";
+});
+</script>
diff --git a/frontend/src/views/sql-editor/SecondarySidebar/InfoTabPane/SchemaPanel/HoverPanel/HoverPanel.vue b/frontend/src/views/sql-editor/SecondarySidebar/InfoTabPane/SchemaPanel/HoverPanel/HoverPanel.vue
new file mode 100644
index 0000000000..3269be6695
--- /dev/null
+++ b/frontend/src/views/sql-editor/SecondarySidebar/InfoTabPane/SchemaPanel/HoverPanel/HoverPanel.vue
@@ -0,0 +1,73 @@
+<template>
+ <div
+ ref="popoverRef"
+ v-zindexable="{ enabled: true }"
+ class="fixed border border-gray-100 rounded bg-white p-2 shadow transition-[top] text-sm"
+ :class="[show ? 'visible' : ' invisible pointer-events-none']"
+ :style="{
+ left: `${position.x - popoverWidth + offsetX}px`,
+ top: `${position.y + offsetY}px`,
+ }"
+ >
+ <template v-if="state">
+ <ColumnInfo
+ v-if="state.column"
+ :db="state.db"
+ :database="state.database"
+ :schema="state.schema"
+ :table="state.table"
+ :column="state.column"
+ />
+ <TableInfo
+ v-else
+ :db="state.db"
+ :database="state.database"
+ :schema="state.schema"
+ :table="state.table"
+ />
+ </template>
+ </div>
+</template>
+
+<script setup lang="ts">
+import { onClickOutside, useElementSize, useEventListener } from "@vueuse/core";
+import { zindexable as vZindexable } from "vdirs";
+import { computed, ref } from "vue";
+import ColumnInfo from "./ColumnInfo.vue";
+import TableInfo from "./TableInfo.vue";
+import { useHoverStateContext } from "./hover-state";
+
+defineProps<{
+ offsetX: number;
+ offsetY: number;
+}>();
+
+const emit = defineEmits<{
+ (event: "click-outside", e: MouseEvent): void;
+}>();
+
+const { state, position, update } = useHoverStateContext();
+
+const popoverRef = ref<HTMLDivElement>();
+onClickOutside(popoverRef, (e) => {
+ emit("click-outside", e);
+});
+const { width: popoverWidth } = useElementSize(popoverRef, undefined, {
+ box: "border-box",
+});
+
+const show = computed(
+ () =>
+ state.value !== undefined &&
+ position.value.x !== 0 &&
+ position.value.y !== 0
+);
+
+useEventListener(popoverRef, "mouseenter", () => {
+ // Reset the value immediately to cancel other pending setting values
+ update(state.value, "before", 0 /* overrideDelay */);
+});
+useEventListener(popoverRef, "mouseleave", () => {
+ update(undefined, "before");
+});
+</script>
diff --git a/frontend/src/views/sql-editor/SecondarySidebar/InfoTabPane/SchemaPanel/HoverPanel/InfoItem.vue b/frontend/src/views/sql-editor/SecondarySidebar/InfoTabPane/SchemaPanel/HoverPanel/InfoItem.vue
new file mode 100644
index 0000000000..435133a7fe
--- /dev/null
+++ b/frontend/src/views/sql-editor/SecondarySidebar/InfoTabPane/SchemaPanel/HoverPanel/InfoItem.vue
@@ -0,0 +1,16 @@
+<template>
+ <div class="contents">
+ <div class="text-gray-500 font-medium">
+ <slot name="title">{{ title }}</slot>
+ </div>
+ <div class="text-main text-right">
+ <slot name="default"></slot>
+ </div>
+ </div>
+</template>
+
+<script setup lang="ts">
+defineProps<{
+ title?: string;
+}>();
+</script>
diff --git a/frontend/src/views/sql-editor/SecondarySidebar/InfoTabPane/SchemaPanel/HoverPanel/TableInfo.vue b/frontend/src/views/sql-editor/SecondarySidebar/InfoTabPane/SchemaPanel/HoverPanel/TableInfo.vue
new file mode 100644
index 0000000000..eb6bde60e7
--- /dev/null
+++ b/frontend/src/views/sql-editor/SecondarySidebar/InfoTabPane/SchemaPanel/HoverPanel/TableInfo.vue
@@ -0,0 +1,84 @@
+<template>
+ <div
+ class="grid min-w-[14rem] max-w-[18rem] gap-x-2 gap-y-1 break-all"
+ style="grid-template-columns: auto 1fr"
+ >
+ <InfoItem :title="$t('common.name')">
+ {{ name }}
+ </InfoItem>
+ <InfoItem v-if="engine" :title="$t('database.engine')">
+ {{ engine }}
+ </InfoItem>
+ <InfoItem :title="$t('database.row-count-estimate')">
+ {{ table.rowCount }}
+ </InfoItem>
+ <InfoItem :title="$t('database.data-size')">
+ {{ bytesToString(table.dataSize.toNumber()) }}
+ </InfoItem>
+ <InfoItem v-if="indexSize" :title="$t('database.index-size')">
+ {{ indexSize }}
+ </InfoItem>
+ <InfoItem v-if="collation" :title="$t('db.collation')">
+ {{ collation }}
+ </InfoItem>
+ </div>
+</template>
+
+<script setup lang="ts">
+import { computed } from "vue";
+import { ComposedDatabase } from "@/types";
+import { Engine } from "@/types/proto/v1/common";
+import {
+ DatabaseMetadata,
+ SchemaMetadata,
+ TableMetadata,
+} from "@/types/proto/v1/database_service";
+import { bytesToString } from "@/utils";
+import InfoItem from "./InfoItem.vue";
+
+const props = defineProps<{
+ db: ComposedDatabase;
+ database: DatabaseMetadata;
+ schema: SchemaMetadata;
+ table: TableMetadata;
+}>();
+
+const instanceEngine = computed(() => props.db.instanceEntity.engine);
+
+const hasSchemaProperty = computed(() => {
+ return [Engine.POSTGRES, Engine.RISINGWAVE].includes(instanceEngine.value);
+});
+
+const name = computed(() => {
+ const { schema, table } = props;
+ if (hasSchemaProperty.value) {
+ return `${schema.name}.${table.name}`;
+ }
+ return table.name;
+});
+
+const engine = computed(() => {
+ if ([Engine.POSTGRES, Engine.SNOWFLAKE].includes(instanceEngine.value)) {
+ return "";
+ }
+ return props.table.engine;
+});
+
+const indexSize = computed(() => {
+ if ([Engine.CLICKHOUSE, Engine.SNOWFLAKE].includes(instanceEngine.value)) {
+ return "";
+ }
+ return bytesToString(props.table.indexSize.toNumber());
+});
+
+const collation = computed(() => {
+ if (
+ [Engine.CLICKHOUSE, Engine.SNOWFLAKE, Engine.POSTGRES].includes(
+ instanceEngine.value
+ )
+ ) {
+ return "";
+ }
+ return props.table.collation;
+});
+</script>
diff --git a/frontend/src/views/sql-editor/SecondarySidebar/InfoTabPane/SchemaPanel/HoverPanel/hover-state.ts b/frontend/src/views/sql-editor/SecondarySidebar/InfoTabPane/SchemaPanel/HoverPanel/hover-state.ts
new file mode 100644
index 0000000000..2bce392ff4
--- /dev/null
+++ b/frontend/src/views/sql-editor/SecondarySidebar/InfoTabPane/SchemaPanel/HoverPanel/hover-state.ts
@@ -0,0 +1,61 @@
+import { InjectionKey, Ref, inject, provide, ref } from "vue";
+import { useDelayedValue } from "@/composables/useDelayedValue";
+import { ComposedDatabase } from "@/types";
+import {
+ ColumnMetadata,
+ DatabaseMetaData,
+ SchemaMetadata,
+ TableMetadata,
+} from "@/types/proto/v1/database_service";
+
+type UpdateFn = ReturnType<typeof useDelayedValue<any>>["update"];
+
+type Position = {
+ x: number;
+ y: number;
+};
+
+export type HoverState = {
+ db: ComposedDatabase;
+ database: DatabaseMetaData;
+ schema: SchemaMetadata;
+ table: TableMetadata;
+ column?: ColumnMetadata;
+};
+
+export type HoverStateContext = {
+ state: Ref<HoverState | undefined>;
+ position: Ref<Position>;
+ update: UpdateFn;
+};
+
+export const KEY = Symbol(
+ "bb.sql-editor.schema-panel.hover-state"
+) as InjectionKey<HoverStateContext>;
+
+export const useHoverStateContext = () => {
+ return inject(KEY)!;
+};
+
+export const provideHoverStateContext = () => {
+ const { value: state, update } = useDelayedValue<HoverState | undefined>(
+ undefined,
+ {
+ delayBefore: 500,
+ delayAfter: 500,
+ }
+ );
+ const position = ref<Position>({
+ x: 0,
+ y: 0,
+ });
+ const context: HoverStateContext = {
+ state,
+ position,
+ update,
+ };
+
+ provide(KEY, context);
+
+ return context;
+};
diff --git a/frontend/src/views/sql-editor/SecondarySidebar/InfoTabPane/SchemaPanel/HoverPanel/index.ts b/frontend/src/views/sql-editor/SecondarySidebar/InfoTabPane/SchemaPanel/HoverPanel/index.ts
new file mode 100644
index 0000000000..fc94dc1e7c
--- /dev/null
+++ b/frontend/src/views/sql-editor/SecondarySidebar/InfoTabPane/SchemaPanel/HoverPanel/index.ts
@@ -0,0 +1,5 @@
+import HoverPanel from "./HoverPanel.vue";
+
+export default HoverPanel;
+export * from "./hover-state";
+export { HoverPanel };
diff --git a/frontend/src/views/sql-editor/SecondarySidebar/InfoTabPane/SchemaPanel/SchemaPanel.vue b/frontend/src/views/sql-editor/SecondarySidebar/InfoTabPane/SchemaPanel/SchemaPanel.vue
index 2a7f9df074..e8b9c97476 100644
--- a/frontend/src/views/sql-editor/SecondarySidebar/InfoTabPane/SchemaPanel/SchemaPanel.vue
+++ b/frontend/src/views/sql-editor/SecondarySidebar/InfoTabPane/SchemaPanel/SchemaPanel.vue
@@ -14,7 +14,7 @@
</div>
<div class="w-full h-full relative overflow-hidden">
- <template v-if="databaseMetadata">
+ <template v-if="databaseMetadata && !isLoading">
<DatabaseSchema
:database="database"
:database-metadata="databaseMetadata"
@@ -26,7 +26,8 @@
<TableSchema
v-if="selected"
class="absolute bottom-0 w-full h-[calc(100%-33px)] bg-white"
- :database="database"
+ :db="database"
+ :database="databaseMetadata"
:schema="selected.schema"
:table="selected.table"
@close="selected = undefined"
@@ -41,21 +42,24 @@
<BBSpin />
</div>
</div>
+
+ <HoverPanel :offset-x="-24" :offset-y="0" />
</div>
</template>
<script lang="ts" setup>
+import { asyncComputed } from "@vueuse/core";
import { storeToRefs } from "pinia";
-import { computed, ref, watch } from "vue";
+import { computed, ref } from "vue";
import { useDatabaseV1ByUID, useDBSchemaV1Store, useTabStore } from "@/store";
import {
- DatabaseMetadata,
SchemaMetadata,
TableMetadata,
DatabaseMetadataView,
} from "@/types/proto/v1/database_service";
import { useSQLEditorContext } from "@/views/sql-editor/context";
import DatabaseSchema from "./DatabaseSchema.vue";
+import { provideHoverStateContext, HoverPanel } from "./HoverPanel";
import TableSchema from "./TableSchema.vue";
import { provideSchemaPanelContext } from "./context";
@@ -65,9 +69,25 @@ const dbSchemaStore = useDBSchemaV1Store();
const { currentTab } = storeToRefs(useTabStore());
const conn = computed(() => currentTab.value.connection);
const { keyword } = provideSchemaPanelContext();
+provideHoverStateContext();
const { database } = useDatabaseV1ByUID(computed(() => conn.value.databaseId));
-const databaseMetadata = ref<DatabaseMetadata>();
+const isLoading = ref(false);
+const databaseMetadata = asyncComputed(
+ async () => {
+ const { name } = database.value;
+ const databaseMetadata = await dbSchemaStore.getOrFetchDatabaseMetadata({
+ database: name,
+ skipCache: false,
+ view: DatabaseMetadataView.DATABASE_METADATA_VIEW_BASIC,
+ });
+ return databaseMetadata;
+ },
+ undefined,
+ {
+ evaluating: isLoading,
+ }
+);
const selected = computed({
get() {
@@ -105,17 +125,4 @@ const handleSelectTable = async (
table: tableMetadata,
};
};
-
-watch(
- () => database.value.name,
- async (name) => {
- if (!name) return;
- databaseMetadata.value = await dbSchemaStore.getOrFetchDatabaseMetadata({
- database: name,
- skipCache: false,
- view: DatabaseMetadataView.DATABASE_METADATA_VIEW_BASIC,
- });
- },
- { immediate: true }
-);
</script>
diff --git a/frontend/src/views/sql-editor/SecondarySidebar/InfoTabPane/SchemaPanel/TableList.vue b/frontend/src/views/sql-editor/SecondarySidebar/InfoTabPane/SchemaPanel/TableList.vue
index b488dbcdf2..8edb8f96eb 100644
--- a/frontend/src/views/sql-editor/SecondarySidebar/InfoTabPane/SchemaPanel/TableList.vue
+++ b/frontend/src/views/sql-editor/SecondarySidebar/InfoTabPane/SchemaPanel/TableList.vue
@@ -9,11 +9,17 @@
<template
#default="{ item: { key, schema, table }, index }: VirtualListItem"
>
- <div class="text-sm leading-6 px-2" :data-key="key" :data-index="index">
+ <div
+ class="bb-table-list--table-item text-sm leading-6 px-1"
+ :data-key="key"
+ :data-index="index"
+ @mouseenter="handleMouseEnter($event, schema, table)"
+ @mouseleave="handleMouseLeave($event, schema, table)"
+ >
<div
- class="flex items-center text-gray-600 whitespace-pre-wrap break-words rounded-sm"
+ class="flex items-center text-gray-600 whitespace-pre-wrap break-words rounded-sm px-1"
:class="
- rowClickable && ['hover:bg-[rgb(243,243,245)]', 'cursor-pointer']
+ rowClickable && ['hover:bg-control-bg-hover/50', 'cursor-pointer']
"
@click="handleClickTable(schema, table)"
>
@@ -29,13 +35,16 @@
<script setup lang="ts">
import { escape } from "lodash-es";
-import { computed } from "vue";
+import { computed, nextTick } from "vue";
import { VirtualList } from "vueuc";
+import { ComposedDatabase } from "@/types";
import {
+ DatabaseMetadata,
SchemaMetadata,
TableMetadata,
} from "@/types/proto/v1/database_service";
-import { getHighlightHTMLByRegExp } from "@/utils";
+import { findAncestor, getHighlightHTMLByRegExp } from "@/utils";
+import { useHoverStateContext } from "./HoverPanel";
import { useSchemaPanelContext } from "./context";
export type SchemaAndTable = {
@@ -50,6 +59,8 @@ export type VirtualListItem = {
};
const props = defineProps<{
+ db: ComposedDatabase;
+ database: DatabaseMetadata;
schemaList: SchemaMetadata[];
rowClickable?: boolean;
}>();
@@ -59,6 +70,11 @@ const emit = defineEmits<{
}>();
const { keyword } = useSchemaPanelContext();
+const {
+ state: hoverState,
+ position: hoverPosition,
+ update: updateHoverState,
+} = useHoverStateContext();
const flattenTableList = computed(() => {
return props.schemaList.flatMap((schema) => {
@@ -106,4 +122,44 @@ const renderTableName = (schema: SchemaMetadata, table: TableMetadata) => {
false /* !caseSensitive */
);
};
+
+const handleMouseEnter = (
+ e: MouseEvent,
+ schema: SchemaMetadata,
+ table: TableMetadata
+) => {
+ const { db, database } = props;
+ if (hoverState.value) {
+ updateHoverState(
+ { db, database, schema, table },
+ "before",
+ 0 /* overrideDelay */
+ );
+ } else {
+ updateHoverState({ db, database, schema, table }, "before");
+ }
+ nextTick().then(() => {
+ // Find the node element and put the database panel to the top-left corner
+ // of the node
+ const wrapper = findAncestor(
+ e.target as HTMLElement,
+ ".bb-table-list--table-item"
+ );
+ if (!wrapper) {
+ updateHoverState(undefined, "after", 0 /* overrideDelay */);
+ return;
+ }
+ const bounding = wrapper.getBoundingClientRect();
+ hoverPosition.value.x = bounding.left;
+ hoverPosition.value.y = bounding.top;
+ });
+};
+
+const handleMouseLeave = (
+ e: MouseEvent,
+ schema: SchemaMetadata,
+ table: TableMetadata
+) => {
+ updateHoverState(undefined, "after");
+};
</script>
diff --git a/frontend/src/views/sql-editor/SecondarySidebar/InfoTabPane/SchemaPanel/TableSchema.vue b/frontend/src/views/sql-editor/SecondarySidebar/InfoTabPane/SchemaPanel/TableSchema.vue
index ed9684923f..ec6e76d541 100644
--- a/frontend/src/views/sql-editor/SecondarySidebar/InfoTabPane/SchemaPanel/TableSchema.vue
+++ b/frontend/src/views/sql-editor/SecondarySidebar/InfoTabPane/SchemaPanel/TableSchema.vue
@@ -16,12 +16,12 @@
:tooltip="$t('common.detail')"
/>
<AlterSchemaButton
- :database="database"
+ :database="db"
:schema="schema"
:table="table"
@click="
editorEvents.emit('alter-schema', {
- databaseUID: database.uid,
+ databaseUID: db.uid,
schema: schema.name,
table: table.name,
})
@@ -30,7 +30,13 @@
</div>
</div>
- <ColumnList :table="table" class="w-full flex-1 py-1" />
+ <ColumnList
+ :db="db"
+ :database="database"
+ :schema="schema"
+ :table="table"
+ class="w-full flex-1 py-1"
+ />
</div>
</template>
@@ -41,6 +47,7 @@ import { computed } from "vue";
import { useActuatorV1Store } from "@/store";
import type { ComposedDatabase } from "@/types";
import type {
+ DatabaseMetadata,
SchemaMetadata,
TableMetadata,
} from "@/types/proto/v1/database_service";
@@ -51,7 +58,8 @@ import ColumnList from "./ColumnList.vue";
import ExternalLinkButton from "./ExternalLinkButton.vue";
const props = defineProps<{
- database: ComposedDatabase;
+ db: ComposedDatabase;
+ database: DatabaseMetadata;
schema: SchemaMetadata;
table: TableMetadata;
}>();
@@ -65,7 +73,7 @@ const actuatorStore = useActuatorV1Store();
const { pageMode } = storeToRefs(actuatorStore);
const tableDetailLink = computed((): string => {
- const { database, schema, table } = props;
+ const { db: database, schema, table } = props;
const query: Record<string, string> = {
table: table.name,
};