Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions src/pages/Editor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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<TableColumn[]>("get_columns", {
connectionId: activeConnectionId,
tableName: table,
...(activeSchema ? { schema: activeSchema } : {}),
...(effectiveSchema ? { schema: effectiveSchema } : {}),
});
const pk = cols.find((c) => c.is_pk);
const autoInc = cols
Expand Down Expand Up @@ -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 });
Expand Down