Skip to content

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

chore: deprecate the middle sidebar (#15713)

ecmadao3b5df63aac3f
diff --git a/frontend/src/views/sql-editor/AsidePanel/SchemaPane/actions.tsx b/frontend/src/views/sql-editor/AsidePanel/SchemaPane/actions.tsx
index be18aa8e63..cde11d5962 100644
--- a/frontend/src/views/sql-editor/AsidePanel/SchemaPane/actions.tsx
+++ b/frontend/src/views/sql-editor/AsidePanel/SchemaPane/actions.tsx
@@ -1,7 +1,8 @@
-import { head } from "lodash-es";
+import { head, cloneDeep } from "lodash-es";
import {
CodeIcon,
CopyIcon,
+ InfoIcon,
ExternalLinkIcon,
FileCodeIcon,
FileDiffIcon,
@@ -11,10 +12,20 @@ import {
LinkIcon,
SquarePenIcon,
} from "lucide-vue-next";
+import {
+ FunctionIcon,
+ TableIcon,
+ ViewIcon,
+ ProcedureIcon,
+ ExternalTableIcon,
+ PackageIcon,
+ SequenceIcon,
+} from "@/components/Icon";
+import { SchemaDiagramIcon } from "@/components/SchemaDiagram";
import { NButton, useDialog, type DropdownOption } from "naive-ui";
import { computed, h, nextTick, ref } from "vue";
+import type { VNodeChild } from "vue";
import { useRouter } from "vue-router";
-import TableIcon from "@/components/Icon/TableIcon.vue";
import formatSQL from "@/components/MonacoEditor/sqlFormatter";
import { useExecuteSQL } from "@/composables/useExecuteSQL";
import { t } from "@/plugins/i18n";
@@ -49,9 +60,11 @@ import {
sortByDictionary,
supportGetStringSchema,
toClipboard,
+ defaultSQLEditorTab,
} from "@/utils";
import { keyWithPosition } from "../../EditorCommon";
import {
+ type EditorPanelView,
useEditorPanelContext,
type EditorPanelViewState,
} from "../../EditorPanel";
@@ -366,6 +379,7 @@ export const useActions = () => {
export const useDropdown = () => {
const router = useRouter();
+ const { updateViewState } = useEditorPanelContext();
const { events: editorEvents, schemaViewer } = useSQLEditorContext();
const { selectAllFromTableOrView, viewDetail } = useActions();
const disallowEditSchema = useAppFeature(
@@ -396,6 +410,76 @@ export const useDropdown = () => {
}
const items: DropdownOptionWithTreeNode[] = [];
+ if (type === "database" || type === "schema") {
+ const actions: { view: EditorPanelView; title: string; icon: () => VNodeChild }[] = [
+ {
+ view: "INFO",
+ title: t("common.info"),
+ icon: () => <InfoIcon class="w-4 h-4" />
+ },
+ {
+ view: "TABLES",
+ title: t("db.tables"),
+ icon: () => <TableIcon class="w-4 h-4" />
+ },
+ {
+ view: "VIEWS",
+ title: t("db.views"),
+ icon: () => <ViewIcon class="w-4 h-4" />
+ },
+ {
+ view: "FUNCTIONS",
+ title: t("db.functions"),
+ icon: () => <FunctionIcon class="w-4 h-4" />
+ },
+ {
+ view: "PROCEDURES",
+ title: t("db.procedures"),
+ icon: () => <ProcedureIcon class="w-4 h-4" />
+ },
+ {
+ view: "SEQUENCES",
+ title: t("db.sequences"),
+ icon: () => <SequenceIcon class="w-4 h-4" />
+ },
+ {
+ view: "PACKAGES",
+ title: t("db.packages"),
+ icon: () => <PackageIcon class="w-4 h-4" />
+ },
+ {
+ view: "EXTERNAL_TABLES",
+ title: t("db.external-tables"),
+ icon: () => <ExternalTableIcon class="w-4 h-4" />
+ },
+ {
+ view: "DIAGRAM",
+ title: t("schema-diagram.self"),
+ icon: () => <SchemaDiagramIcon class="w-4 h-4" />
+ },
+ ]
+ for (const action of actions) {
+ items.push({
+ key: action.view,
+ label: action.title,
+ icon: action.icon,
+ onSelect: () => {
+ const tabStore = useSQLEditorTabStore()
+ const fromTab = tabStore.currentTab;
+ const clonedTab = defaultSQLEditorTab();
+ if (fromTab) {
+ clonedTab.connection = cloneDeep(fromTab.connection);
+ clonedTab.treeState = cloneDeep(fromTab.treeState);
+ }
+ clonedTab.status = "CLEAN";
+ clonedTab.title = action.title;
+ tabStore.addTab(clonedTab);
+ nextTick(() => updateViewState({ view: action.view }))
+ }
+ })
+ }
+ }
+
if (type === "table" || type === "view") {
const schema = (target as NodeTarget<"table" | "view">).schema.name;
const tableOrView = tableOrViewNameForNode(node);
diff --git a/frontend/src/views/sql-editor/ConnectionPanel/ConnectionPane/ConnectionPane.vue b/frontend/src/views/sql-editor/ConnectionPanel/ConnectionPane/ConnectionPane.vue
index e933ab5d01..1a2256fbc1 100644
--- a/frontend/src/views/sql-editor/ConnectionPanel/ConnectionPane/ConnectionPane.vue
+++ b/frontend/src/views/sql-editor/ConnectionPanel/ConnectionPane/ConnectionPane.vue
@@ -23,9 +23,10 @@
</div>
<div
ref="treeContainerElRef"
- class="sql-editor-tree--tree flex-1 px-1 pb-1 text-sm overflow-hidden select-none"
+ class="relative sql-editor-tree--tree flex-1 px-1 pb-1 text-sm overflow-hidden select-none"
:data-height="treeContainerHeight"
>
+ <MaskSpinner v-if="editrStore.loading" class="!bg-white/75" />
<NTree
v-if="treeStore.state === 'READY'"
ref="treeRef"
@@ -143,11 +144,6 @@ const { height: treeContainerHeight } = useElementSize(
const treeRef = ref<InstanceType<typeof NTree>>();
const searchPattern = ref("");
-watch(
- () => searchPattern.value,
- (search) => editrStore.prepareDatabases(search)
-);
-
// Highlight the current tab's connection node.
const selectedKeys = computedAsync(async () => {
const connection = tabStore.currentTab?.connection;
@@ -169,14 +165,17 @@ const selectedKeys = computedAsync(async () => {
}
return [];
}, []);
+
const { expandedKeys, hasMissingQueryDatabases, showMissingQueryDatabases } =
storeToRefs(treeStore);
+
const upsertExpandedKeys = (key: string) => {
if (expandedKeys.value.includes(key)) {
return;
}
expandedKeys.value.push(key);
};
+
const expandNode = (
node: SQLEditorTreeNode | undefined,
keys?: Set<string>
@@ -218,10 +217,6 @@ const expandNodesByType = <T extends SQLEditorTreeNodeType>(
return nodes;
};
-const canQueryDatabase = (database: ComposedDatabase): boolean => {
- return isDatabaseV1Queryable(database);
-};
-
// dynamic render the highlight keywords
const renderLabel = ({ option }: { option: TreeOption }) => {
const node = option as any as SQLEditorTreeNode;
@@ -243,7 +238,7 @@ const nodeProps = ({ option }: { option: TreeOption }) => {
// Check if clicked on the content part.
// And ignore the fold/unfold arrow.
if (type === "database") {
- if (canQueryDatabase(node.meta.target as ComposedDatabase)) {
+ if (isDatabaseV1Queryable(node.meta.target as ComposedDatabase)) {
setConnection(node, {
extra: {
worksheet: tabStore.currentTab?.worksheet ?? "",
@@ -396,6 +391,13 @@ useEmitteryEventListener(editorEvents, "tree-ready", () => {
});
onMounted(() => calcDefaultExpandKeys(false));
+
+watch(
+ () => searchPattern.value,
+ (search) =>
+ editrStore.prepareDatabases(search).then(() => calcDefaultExpandKeys(true)),
+ { immediate: true }
+);
</script>
<style lang="postcss" scoped>
diff --git a/frontend/src/views/sql-editor/EditorCommon/DatabaseChooser.vue b/frontend/src/views/sql-editor/EditorCommon/DatabaseChooser.vue
index 668184fd68..da8e98d48a 100644
--- a/frontend/src/views/sql-editor/EditorCommon/DatabaseChooser.vue
+++ b/frontend/src/views/sql-editor/EditorCommon/DatabaseChooser.vue
@@ -1,6 +1,6 @@
<template>
<NButton
- :disabled="!projectContextReady"
+ :disabled="disabled || !projectContextReady"
type="primary"
size="small"
ghost
@@ -69,6 +69,10 @@ const { instance, database } = useConnectionOfCurrentSQLEditorTab();
const changeConnection = () => {
showConnectionPanel.value = true;
};
+
+defineProps<{
+ disabled?: boolean;
+}>();
</script>
<style lang="postcss" scoped>
diff --git a/frontend/src/views/sql-editor/EditorPanel/GutterBar/GutterBar.vue b/frontend/src/views/sql-editor/EditorPanel/GutterBar/GutterBar.vue
deleted file mode 100644
index 2f625aff3d..0000000000
--- a/frontend/src/views/sql-editor/EditorPanel/GutterBar/GutterBar.vue
+++ /dev/null
@@ -1,22 +0,0 @@
-<template>
- <div
- v-if="show"
- class="h-full flex flex-col items-stretch justify-between overflow-hidden text-sm p-1 shrink-0"
- >
- <div class="flex flex-col gap-y-1">
- <TabItem v-for="view in availableViews" :key="view" :view="view" />
- </div>
- </div>
-</template>
-
-<script setup lang="ts">
-import { computed } from "vue";
-import { useEditorPanelContext } from "../context";
-import TabItem from "./TabItem.vue";
-
-const { viewState, availableViews } = useEditorPanelContext();
-
-const show = computed(() => {
- return viewState.value?.view !== undefined;
-});
-</script>
diff --git a/frontend/src/views/sql-editor/EditorPanel/GutterBar/TabItem.vue b/frontend/src/views/sql-editor/EditorPanel/GutterBar/TabItem.vue
deleted file mode 100644
index 3be64dcb0a..0000000000
--- a/frontend/src/views/sql-editor/EditorPanel/GutterBar/TabItem.vue
+++ /dev/null
@@ -1,107 +0,0 @@
-<template>
- <NTooltip placement="right" :delay="300" :disabled="disabled">
- <template #trigger>
- <NButton
- :style="buttonStyle"
- v-bind="{ ...buttonProps, ...$attrs }"
- @click="handleClick"
- >
- <template #icon>
- <CodeIcon v-if="view === 'CODE'" :class="iconClass" />
- <InfoIcon v-if="view === 'INFO'" :class="iconClass" />
- <TableIcon v-if="view === 'TABLES'" :class="iconClass" />
- <ViewIcon v-if="view === 'VIEWS'" :class="iconClass" />
- <FunctionIcon v-if="view === 'FUNCTIONS'" :class="iconClass" />
- <ProcedureIcon v-if="view === 'PROCEDURES'" :class="iconClass" />
- <SequenceIcon v-if="view === 'SEQUENCES'" :class="iconClass" />
- <PackageIcon v-if="view === 'PACKAGES'" :class="iconClass" />
- <ExternalTableIcon
- v-if="view === 'EXTERNAL_TABLES'"
- :class="iconClass"
- />
- <SchemaDiagramIcon v-if="view === 'DIAGRAM'" :class="iconClass" />
- </template>
- </NButton>
- </template>
- <template #default>
- {{ text }}
- </template>
- </NTooltip>
-</template>
-
-<script setup lang="ts">
-import { CodeIcon, InfoIcon } from "lucide-vue-next";
-import { NButton, NTooltip } from "naive-ui";
-import { computed, toRef } from "vue";
-import { useI18n } from "vue-i18n";
-import {
- FunctionIcon,
- TableIcon,
- ViewIcon,
- ProcedureIcon,
- ExternalTableIcon,
- PackageIcon,
- SequenceIcon,
-} from "@/components/Icon";
-import { SchemaDiagramIcon } from "@/components/SchemaDiagram";
-import { useEditorPanelContext } from "../context";
-import type { EditorPanelView } from "../types";
-import { useButton } from "./common";
-
-const props = defineProps<{
- view: EditorPanelView;
- disabled?: boolean;
-}>();
-
-const { t } = useI18n();
-
-const active = computed(() => props.view === viewState.value?.view);
-const { viewState, updateViewState } = useEditorPanelContext();
-const { props: buttonProps, style: buttonStyle } = useButton({
- active,
- disabled: toRef(props, "disabled"),
-});
-
-const text = computed(() => {
- switch (props.view) {
- case "CODE":
- return t("common.sql");
- case "INFO":
- return t("common.info");
- case "TABLES":
- return t("db.tables");
- case "VIEWS":
- return t("db.views");
- case "FUNCTIONS":
- return t("db.functions");
- case "PROCEDURES":
- return t("db.procedures");
- case "SEQUENCES":
- return t("db.sequences");
- case "PACKAGES":
- return t("db.packages");
- case "EXTERNAL_TABLES":
- return t("db.external-tables");
- case "DIAGRAM":
- return t("schema-diagram.self");
- }
- console.assert(false, "should never reach this line");
- return "";
-});
-
-const iconClass = computed(() => {
- const classes = ["w-4", "h-4"];
- if (active.value) {
- classes.push("!text-current");
- } else {
- classes.push("text-main");
- }
- return classes;
-});
-
-const handleClick = () => {
- updateViewState({
- view: props.view,
- });
-};
-</script>
diff --git a/frontend/src/views/sql-editor/EditorPanel/GutterBar/common.ts b/frontend/src/views/sql-editor/EditorPanel/GutterBar/common.ts
deleted file mode 100644
index 8afe9676d0..0000000000
--- a/frontend/src/views/sql-editor/EditorPanel/GutterBar/common.ts
+++ /dev/null
@@ -1,34 +0,0 @@
-import type { ButtonProps } from "naive-ui";
-import { computed, unref, type MaybeRef } from "vue";
-
-export const useButton = (options: {
- active: MaybeRef<boolean>;
- disabled: MaybeRef<boolean>;
-}) => {
- const props = computed(() => {
- const props: ButtonProps = {
- tag: "div",
- disabled: unref(options.disabled),
- size: "small",
- };
- if (unref(options.active)) {
- props.secondary = true;
- props.type = "primary";
- } else {
- props.quaternary = true;
- props.type = "default";
- }
- props.disabled = unref(options.disabled);
-
- return props;
- });
- const style = computed(() => {
- const parts: string[] = [];
-
- parts.push("--n-height: 32px");
- parts.push("--n-padding: 4px 8px");
- parts.push("--n-icon-size: 16px");
- return parts.join("; ");
- });
- return { props, style };
-};
diff --git a/frontend/src/views/sql-editor/EditorPanel/GutterBar/index.ts b/frontend/src/views/sql-editor/EditorPanel/GutterBar/index.ts
deleted file mode 100644
index 840d765ac2..0000000000
--- a/frontend/src/views/sql-editor/EditorPanel/GutterBar/index.ts
+++ /dev/null
@@ -1,3 +0,0 @@
-import GutterBar from "./GutterBar.vue";
-
-export default GutterBar;
diff --git a/frontend/src/views/sql-editor/EditorPanel/Panels/ExternalTablesPanel/ExternalTablesPanel.vue b/frontend/src/views/sql-editor/EditorPanel/Panels/ExternalTablesPanel/ExternalTablesPanel.vue
index 2e2949a5f7..a00729d07e 100644
--- a/frontend/src/views/sql-editor/EditorPanel/Panels/ExternalTablesPanel/ExternalTablesPanel.vue
+++ b/frontend/src/views/sql-editor/EditorPanel/Panels/ExternalTablesPanel/ExternalTablesPanel.vue
@@ -5,19 +5,13 @@
>
<div
v-show="!metadata.externalTable"
- class="w-full flex flex-row gap-x-2 justify-between items-center"
+ class="w-full flex flex-row gap-x-2 justify-end items-center"
>
- <div class="flex items-center justify-start gap-2">
- <DatabaseChooser />
- <SchemaSelectToolbar simple />
- </div>
- <div class="flex items-center justify-end">
- <SearchBox
- v-model:value="state.keywords.table"
- size="small"
- style="width: 10rem"
- />
- </div>
+ <SearchBox
+ v-model:value="state.keywords.table"
+ size="small"
+ style="width: 10rem"
+ />
</div>
<ExternalTablesTable
v-show="!metadata.externalTable"
@@ -76,9 +70,7 @@ import {
SchemaMetadata,
ExternalTableMetadata,
} from "@/types/proto/v1/database_service";
-import DatabaseChooser from "@/views/sql-editor/EditorCommon/DatabaseChooser.vue";
import { useEditorPanelContext } from "../../context";
-import { SchemaSelectToolbar } from "../common";
import ExternalTableColumnsTable from "./ExternalTableColumnsTable.vue";
import ExternalTablesTable from "./ExternalTablesTable.vue";
diff --git a/frontend/src/views/sql-editor/EditorPanel/Panels/FunctionsPanel/FunctionsPanel.vue b/frontend/src/views/sql-editor/EditorPanel/Panels/FunctionsPanel/FunctionsPanel.vue
index 0e853c9587..a6c576eb10 100644
--- a/frontend/src/views/sql-editor/EditorPanel/Panels/FunctionsPanel/FunctionsPanel.vue
+++ b/frontend/src/views/sql-editor/EditorPanel/Panels/FunctionsPanel/FunctionsPanel.vue
@@ -2,19 +2,13 @@
<div v-if="metadata?.schema" class="h-full overflow-hidden flex flex-col">
<div
v-show="!metadata.func"
- class="w-full h-[44px] py-2 px-2 border-b flex flex-row gap-x-2 justify-between items-center"
+ class="w-full h-[44px] py-2 px-2 border-b flex flex-row gap-x-2 justify-end items-center"
>
- <div class="flex items-center justify-start gap-2">
- <DatabaseChooser />
- <SchemaSelectToolbar simple />
- </div>
- <div class="flex items-center justify-end">
- <SearchBox
- v-model:value="state.keyword"
- size="small"
- style="width: 10rem"
- />
- </div>
+ <SearchBox
+ v-model:value="state.keyword"
+ size="small"
+ style="width: 10rem"
+ />
</div>
<FunctionsTable
v-show="!metadata.func"
@@ -58,9 +52,8 @@ import {
extractKeyWithPosition,
keyWithPosition,
} from "@/views/sql-editor/EditorCommon";
-import DatabaseChooser from "@/views/sql-editor/EditorCommon/DatabaseChooser.vue";
import { useEditorPanelContext } from "../../context";
-import { SchemaSelectToolbar, CodeViewer } from "../common";
+import { CodeViewer } from "../common";
import FunctionsTable from "./FunctionsTable.vue";
const { database } = useConnectionOfCurrentSQLEditorTab();
diff --git a/frontend/src/views/sql-editor/EditorPanel/Panels/InfoPanel/InfoPanel.vue b/frontend/src/views/sql-editor/EditorPanel/Panels/InfoPanel/InfoPanel.vue
index 3ad51b5568..953001dcc0 100644
--- a/frontend/src/views/sql-editor/EditorPanel/Panels/InfoPanel/InfoPanel.vue
+++ b/frontend/src/views/sql-editor/EditorPanel/Panels/InfoPanel/InfoPanel.vue
@@ -1,12 +1,5 @@
<template>
<div class="px-2 py-2 gap-4 h-full overflow-hidden flex flex-col">
- <div class="w-full flex flex-row gap-x-2 justify-between items-center">
- <div class="flex items-center justify-start gap-2">
- <DatabaseChooser />
- <SchemaSelectToolbar simple />
- </div>
- </div>
-
<div class="flex-1 overflow-auto flex flex-col gap-4">
<DatabaseOverviewInfo :database="database" />
@@ -227,7 +220,6 @@ import {
instanceV1SupportsSequence,
} from "@/utils";
import { keyWithPosition } from "@/views/sql-editor/EditorCommon";
-import DatabaseChooser from "@/views/sql-editor/EditorCommon/DatabaseChooser.vue";
import { useEditorPanelContext } from "../../context";
import ExternalTablesTable from "../ExternalTablesPanel/ExternalTablesTable.vue";
import FunctionsTable from "../FunctionsPanel/FunctionsTable.vue";
@@ -236,7 +228,6 @@ import ProceduresTable from "../ProceduresPanel/ProceduresTable.vue";
import SequencesTable from "../SequencesPanel/SequencesTable.vue";
import TablesTable from "../TablesPanel/TablesTable.vue";
import ViewsTable from "../ViewsPanel/ViewsTable.vue";
-import { SchemaSelectToolbar } from "../common";
const state = reactive({
keywords: {
diff --git a/frontend/src/views/sql-editor/EditorPanel/Panels/PackagesPanel/PackagesPanel.vue b/frontend/src/views/sql-editor/EditorPanel/Panels/PackagesPanel/PackagesPanel.vue
index f22f9201f5..366a8f7113 100644
--- a/frontend/src/views/sql-editor/EditorPanel/Panels/PackagesPanel/PackagesPanel.vue
+++ b/frontend/src/views/sql-editor/EditorPanel/Panels/PackagesPanel/PackagesPanel.vue
@@ -2,19 +2,13 @@
<div v-if="metadata?.schema" class="h-full overflow-hidden flex flex-col">
<div
v-show="!metadata.package"
- class="w-full h-[44px] py-2 px-2 border-b flex flex-row gap-x-2 justify-between items-center"
+ class="w-full h-[44px] py-2 px-2 border-b flex flex-row gap-x-2 justify-end items-center"
>
- <div class="flex items-center justify-start gap-2">
- <DatabaseChooser />
- <SchemaSelectToolbar simple />
- </div>
- <div class="flex items-center justify-end">
- <SearchBox
- v-model:value="state.keyword"
- size="small"
- style="width: 10rem"
- />
- </div>
+ <SearchBox
+ v-model:value="state.keyword"
+ size="small"
+ style="width: 10rem"
+ />
</div>
<PackagesTable
v-show="!metadata.package"
@@ -58,9 +52,8 @@ import {
extractKeyWithPosition,
keyWithPosition,
} from "@/views/sql-editor/EditorCommon";
-import DatabaseChooser from "@/views/sql-editor/EditorCommon/DatabaseChooser.vue";
import { useEditorPanelContext } from "../../context";
-import { SchemaSelectToolbar, CodeViewer } from "../common";
+import { CodeViewer } from "../common";
import PackagesTable from "./PackagesTable.vue";
const { database } = useConnectionOfCurrentSQLEditorTab();
diff --git a/frontend/src/views/sql-editor/EditorPanel/Panels/Panels.vue b/frontend/src/views/sql-editor/EditorPanel/Panels/Panels.vue
index e3cca7ea1d..6dee1e783e 100644
--- a/frontend/src/views/sql-editor/EditorPanel/Panels/Panels.vue
+++ b/frontend/src/views/sql-editor/EditorPanel/Panels/Panels.vue
@@ -1,26 +1,45 @@
<template>
<div class="flex-1 flex items-stretch overflow-hidden">
- <GutterBar class="border-r border-control-border" :class="gutterBarClass" />
-
<div class="flex-1 overflow-y-hidden overflow-x-auto" :class="contentClass">
<slot v-if="!viewState || viewState.view === 'CODE'" name="code-panel" />
- <template v-if="viewState">
- <InfoPanel v-if="viewState.view === 'INFO'" :key="tab?.id" />
- <TablesPanel v-if="viewState.view === 'TABLES'" :key="tab?.id" />
- <ViewsPanel v-if="viewState.view === 'VIEWS'" :key="tab?.id" />
- <FunctionsPanel v-if="viewState.view === 'FUNCTIONS'" :key="tab?.id" />
- <ProceduresPanel
- v-if="viewState.view === 'PROCEDURES'"
- :key="tab?.id"
- />
- <SequencesPanel v-if="viewState.view === 'SEQUENCES'" :key="tab?.id" />
- <PackagesPanel v-if="viewState.view === 'PACKAGES'" :key="tab?.id" />
- <ExternalTablesPanel
- v-if="viewState.view === 'EXTERNAL_TABLES'"
- :key="tab?.id"
- />
- <DiagramPanel v-if="viewState.view === 'DIAGRAM'" :key="tab?.id" />
+ <template v-if="viewState && viewState.view !== 'CODE'">
+ <div class="h-full flex flex-col">
+ <div
+ class="py-2 px-2 w-full flex flex-row gap-x-2 justify-between items-center"
+ >
+ <div class="flex items-center justify-start gap-2">
+ <DatabaseChooser :disabled="true" />
+ <SchemaSelectToolbar simple />
+ </div>
+ </div>
+ <div class="flex-1">
+ <InfoPanel v-if="viewState.view === 'INFO'" :key="tab?.id" />
+ <TablesPanel v-if="viewState.view === 'TABLES'" :key="tab?.id" />
+ <ViewsPanel v-if="viewState.view === 'VIEWS'" :key="tab?.id" />
+ <FunctionsPanel
+ v-if="viewState.view === 'FUNCTIONS'"
+ :key="tab?.id"
+ />
+ <ProceduresPanel
+ v-if="viewState.view === 'PROCEDURES'"
+ :key="tab?.id"
+ />
+ <SequencesPanel
+ v-if="viewState.view === 'SEQUENCES'"
+ :key="tab?.id"
+ />
+ <PackagesPanel
+ v-if="viewState.view === 'PACKAGES'"
+ :key="tab?.id"
+ />
+ <ExternalTablesPanel
+ v-if="viewState.view === 'EXTERNAL_TABLES'"
+ :key="tab?.id"
+ />
+ <DiagramPanel v-if="viewState.view === 'DIAGRAM'" :key="tab?.id" />
+ </div>
+ </div>
</template>
</div>
</div>
@@ -46,7 +65,7 @@ import {
nextAnimationFrame,
type VueClass,
} from "@/utils";
-import GutterBar from "../GutterBar";
+import DatabaseChooser from "@/views/sql-editor/EditorCommon/DatabaseChooser.vue";
import { useEditorPanelContext } from "../context";
import DiagramPanel from "./DiagramPanel";
import ExternalTablesPanel from "./ExternalTablesPanel";
@@ -57,6 +76,7 @@ import ProceduresPanel from "./ProceduresPanel";
import SequencesPanel from "./SequencesPanel";
import TablesPanel from "./TablesPanel";
import ViewsPanel from "./ViewsPanel";
+import { SchemaSelectToolbar } from "./common";
defineProps<{
gutterBarClass?: VueClass;
diff --git a/frontend/src/views/sql-editor/EditorPanel/Panels/ProceduresPanel/ProceduresPanel.vue b/frontend/src/views/sql-editor/EditorPanel/Panels/ProceduresPanel/ProceduresPanel.vue
index 4bb2842457..822293d90c 100644
--- a/frontend/src/views/sql-editor/EditorPanel/Panels/ProceduresPanel/ProceduresPanel.vue
+++ b/frontend/src/views/sql-editor/EditorPanel/Panels/ProceduresPanel/ProceduresPanel.vue
@@ -2,19 +2,13 @@
<div v-if="metadata?.schema" class="h-full overflow-hidden flex flex-col">
<div
v-show="!metadata.procedure"
- class="w-full h-[44px] py-2 px-2 border-b flex flex-row gap-x-2 justify-between items-center"
+ class="w-full h-[44px] py-2 px-2 border-b flex flex-row gap-x-2 justify-end items-center"
>
- <div class="flex items-center justify-start gap-2">
- <DatabaseChooser />
- <SchemaSelectToolbar simple />
- </div>
- <div class="flex items-center justify-end">
- <SearchBox
- v-model:value="state.keyword"
- size="small"
- style="width: 10rem"
- />
- </div>
+ <SearchBox
+ v-model:value="state.keyword"
+ size="small"
+ style="width: 10rem"
+ />
</div>
<ProceduresTable
v-show="!metadata.procedure"
@@ -58,9 +52,8 @@ import {
extractKeyWithPosition,
keyWithPosition,
} from "@/views/sql-editor/EditorCommon";
-import DatabaseChooser from "@/views/sql-editor/EditorCommon/DatabaseChooser.vue";
import { useEditorPanelContext } from "../../context";
-import { SchemaSelectToolbar, CodeViewer } from "../common";
+import { CodeViewer } from "../common";
import ProceduresTable from "./ProceduresTable.vue";
const { database } = useConnectionOfCurrentSQLEditorTab();
diff --git a/frontend/src/views/sql-editor/EditorPanel/Panels/SequencesPanel/SequencesPanel.vue b/frontend/src/views/sql-editor/EditorPanel/Panels/SequencesPanel/SequencesPanel.vue
index ba9cba5a60..e992130ff7 100644
--- a/frontend/src/views/sql-editor/EditorPanel/Panels/SequencesPanel/SequencesPanel.vue
+++ b/frontend/src/views/sql-editor/EditorPanel/Panels/SequencesPanel/SequencesPanel.vue
@@ -2,19 +2,13 @@
<div v-if="metadata?.schema" class="h-full overflow-hidden flex flex-col">
<div
v-show="!metadata.func"
- class="w-full h-[44px] py-2 px-2 border-b flex flex-row gap-x-2 justify-between items-center"
+ class="w-full h-[44px] py-2 px-2 border-b flex flex-row gap-x-2 justify-end items-center"
>
- <div class="flex items-center justify-start gap-2">
- <DatabaseChooser />
- <SchemaSelectToolbar simple />
- </div>
- <div class="flex items-center justify-end">
- <SearchBox
- v-model:value="state.keyword"
- size="small"
- style="width: 10rem"
- />
- </div>
+ <SearchBox
+ v-model:value="state.keyword"
+ size="small"
+ style="width: 10rem"
+ />
</div>
<SequencesTable
:db="database"
@@ -43,9 +37,7 @@ import {
extractKeyWithPosition,
keyWithPosition,
} from "@/views/sql-editor/EditorCommon";
-import DatabaseChooser from "@/views/sql-editor/EditorCommon/DatabaseChooser.vue";
import { useEditorPanelContext } from "../../context";
-import { SchemaSelectToolbar } from "../common";
import SequencesTable from "./SequencesTable.vue";
const { database } = useConnectionOfCurrentSQLEditorTab();
diff --git a/frontend/src/views/sql-editor/EditorPanel/Panels/TablesPanel/TablesPanel.vue b/frontend/src/views/sql-editor/EditorPanel/Panels/TablesPanel/TablesPanel.vue
index 71da10fac8..388c624b96 100644
--- a/frontend/src/views/sql-editor/EditorPanel/Panels/TablesPanel/TablesPanel.vue
+++ b/frontend/src/views/sql-editor/EditorPanel/Panels/TablesPanel/TablesPanel.vue
@@ -5,19 +5,13 @@
>
<div
v-show="!metadata.table"
- class="w-full flex flex-row gap-x-2 justify-between items-center"
+ class="w-full flex flex-row gap-x-2 justify-end items-center"
>
- <div class="flex items-center justify-start gap-2">
- <DatabaseChooser />
- <SchemaSelectToolbar simple />
- </div>
- <div class="flex items-center justify-end">
- <SearchBox
- v-model:value="state.keywords.table"
- size="small"
- style="width: 10rem"
- />
- </div>
+ <SearchBox
+ v-model:value="state.keywords.table"
+ size="small"
+ style="width: 10rem"
+ />
</div>
<TablesTable
v-show="!metadata.table"
@@ -52,9 +46,7 @@ import {
TableMetadata,
TablePartitionMetadata,
} from "@/types/proto/v1/database_service";
-import DatabaseChooser from "@/views/sql-editor/EditorCommon/DatabaseChooser.vue";
import { useEditorPanelContext } from "../../context";
-import { SchemaSelectToolbar } from "../common";
import TableDetail from "./TableDetail.vue";
import TablesTable from "./TablesTable.vue";
diff --git a/frontend/src/views/sql-editor/EditorPanel/Panels/ViewsPanel/ViewsPanel.vue b/frontend/src/views/sql-editor/EditorPanel/Panels/ViewsPanel/ViewsPanel.vue
index 8692fc07a2..ad029b8b1e 100644
--- a/frontend/src/views/sql-editor/EditorPanel/Panels/ViewsPanel/ViewsPanel.vue
+++ b/frontend/src/views/sql-editor/EditorPanel/Panels/ViewsPanel/ViewsPanel.vue
@@ -2,19 +2,13 @@
<div v-if="metadata?.schema" class="h-full overflow-hidden flex flex-col">
<div
v-show="!metadata.view"
- class="w-full h-[44px] py-2 px-2 border-b flex flex-row gap-x-2 justify-between items-center"
+ class="w-full h-[44px] py-2 px-2 border-b flex flex-row gap-x-2 justify-end items-center"
>
- <div class="flex items-center justify-start gap-2">
- <DatabaseChooser />
- <SchemaSelectToolbar simple />
- </div>
- <div class="flex items-center justify-end">
- <SearchBox
- v-model:value="state.keyword"
- size="small"
- style="width: 10rem"
- />
- </div>
+ <SearchBox
+ v-model:value="state.keyword"
+ size="small"
+ style="width: 10rem"
+ />
</div>
<ViewsTable
@@ -49,9 +43,7 @@ import {
ViewMetadata,
SchemaMetadata,
} from "@/types/proto/v1/database_service";
-import DatabaseChooser from "@/views/sql-editor/EditorCommon/DatabaseChooser.vue";
import { useEditorPanelContext } from "../../context";
-import { SchemaSelectToolbar } from "../common";
import ViewDetail from "./ViewDetail.vue";
import ViewsTable from "./ViewsTable.vue";