Skip to content

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

fix(sql-editor): parent key of column nodes (#13663)

boojackbf2c4175beb8
diff --git a/frontend/src/views/sql-editor/AsidePanel/SchemaPane/common.ts b/frontend/src/views/sql-editor/AsidePanel/SchemaPane/common.ts
index 7aabad06e3..44ea33f434 100644
--- a/frontend/src/views/sql-editor/AsidePanel/SchemaPane/common.ts
+++ b/frontend/src/views/sql-editor/AsidePanel/SchemaPane/common.ts
@@ -191,7 +191,9 @@ export const keyForNodeTarget = <T extends NodeType>(
"external-table",
target as NodeTarget<"external-table">
)
- : keyForNodeTarget("view", target as NodeTarget<"view">);
+ : "view" in target
+ ? keyForNodeTarget("view", target as NodeTarget<"view">)
+ : ""; // Fall back to empty string.
const { column } = target as NodeTarget<"column">;
return [parentKey, `columns/${column.name}`].join("/");
}