From 3171f8ae7d21a56225711a64d8b4fcb42e70a151 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20M=C3=BCller-Wasle?= Date: Thu, 23 Apr 2026 15:59:53 +0200 Subject: [PATCH] bug: fix the editbility of data in some cases --- src/pages/Editor.tsx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/pages/Editor.tsx b/src/pages/Editor.tsx index 065fa61c..dbc25edc 100644 --- a/src/pages/Editor.tsx +++ b/src/pages/Editor.tsx @@ -493,13 +493,14 @@ export const Editor = () => { }, [tabs, updateScrollArrows]); const fetchPkColumn = useCallback( - async (table: string, tabId?: string) => { + async (table: string, tabId?: string, tabSchema?: string) => { if (!activeConnectionId) return; + const effectiveSchema = tabSchema ?? activeSchema; try { const cols = await invoke("get_columns", { connectionId: activeConnectionId, tableName: table, - ...(activeSchema ? { schema: activeSchema } : {}), + ...(effectiveSchema ? { schema: effectiveSchema } : {}), }); const pk = cols.find((c) => c.is_pk); const autoInc = cols @@ -683,7 +684,7 @@ export const Editor = () => { if (tableName) { // Wait for PK column to be fetched before showing results - await fetchPkColumn(tableName, targetTabId); + await fetchPkColumn(tableName, targetTabId, targetTab?.schema ?? undefined); } else { // No table, explicitly set pkColumn to null (read-only mode) updateTab(targetTabId, { pkColumn: null });