feat(hbase): improve desktop connections and table operations
This commit is contained in:
17 files changed
+514
-50
No files matched your search
@@ -156,6 +156,26 @@ describe("queryStore database open state", () => {
|
||||
expect(store.tabs.some((tab) => tab.id === structureId)).toBe(true);
|
||||
});
|
||||
|
||||
it("closes only the matching HBase table tab after deletion", async () => {
|
||||
const { useQueryStore } = await import("@/stores/queryStore");
|
||||
const store = useQueryStore();
|
||||
|
||||
const deletedTableId = store.createTab("hbase-1", "metrics", "events", "hbase", undefined, "events");
|
||||
const otherTableId = store.createTab("hbase-1", "metrics", "archive", "hbase", undefined, "archive");
|
||||
const otherNamespaceId = store.createTab("hbase-1", "default", "events", "hbase", undefined, "events");
|
||||
|
||||
store.closeDroppedTableObjectTabs({
|
||||
connectionId: "hbase-1",
|
||||
database: "metrics",
|
||||
name: "events",
|
||||
objectType: "TABLE",
|
||||
});
|
||||
|
||||
expect(store.tabs.some((tab) => tab.id === deletedTableId)).toBe(false);
|
||||
expect(store.tabs.some((tab) => tab.id === otherTableId)).toBe(true);
|
||||
expect(store.tabs.some((tab) => tab.id === otherNamespaceId)).toBe(true);
|
||||
});
|
||||
|
||||
it("matches dropped table schema candidates", async () => {
|
||||
const { useQueryStore } = await import("@/stores/queryStore");
|
||||
const store = useQueryStore();
|
||||
|
||||
@@ -2012,6 +2012,10 @@ export const useQueryStore = defineStore("query", () => {
|
||||
if (tab.connectionId !== target.connectionId || tab.database !== target.database) return false;
|
||||
const targetSchemas = droppedTableObjectSchemaCandidates(target);
|
||||
|
||||
if ((target.objectType ?? "TABLE") === "TABLE" && tab.mode === "hbase") {
|
||||
return tab.sql === target.name;
|
||||
}
|
||||
|
||||
if (tab.mode === "data") {
|
||||
const tableMeta = tableMetaForDataTab(tab);
|
||||
if (!tableMeta || tableMeta.tableName !== target.name) return false;
|
||||
|
||||
Reference in new issue
Block a user